{"id":13618320,"url":"https://github.com/ankur4u007/drift","last_synced_at":"2025-04-13T15:36:15.986Z","repository":{"id":76127827,"uuid":"163009325","full_name":"ankur4u007/drift","owner":"ankur4u007","description":"Drift: A Websocket-Http Tunnel written in kotlin that lets you access any HTTP Api on servers deployed behind firewall(s)/Nat(s)/Proxy","archived":false,"fork":false,"pushed_at":"2019-01-13T11:21:34.000Z","size":324,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T06:34:34.919Z","etag":null,"topics":["firewall","homeserver","mitm","tunnel","websocket","websocket-http-tunnel"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankur4u007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-12-24T16:52:35.000Z","updated_at":"2023-05-12T16:53:21.000Z","dependencies_parsed_at":"2023-07-03T06:45:49.918Z","dependency_job_id":null,"html_url":"https://github.com/ankur4u007/drift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankur4u007%2Fdrift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankur4u007%2Fdrift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankur4u007%2Fdrift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankur4u007%2Fdrift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankur4u007","download_url":"https://codeload.github.com/ankur4u007/drift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248737395,"owners_count":21153760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firewall","homeserver","mitm","tunnel","websocket","websocket-http-tunnel"],"created_at":"2024-08-01T20:01:58.705Z","updated_at":"2025-04-13T15:36:15.952Z","avatar_url":"https://github.com/ankur4u007.png","language":"Kotlin","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# drift\n\n\u003cimg width=\"600\" alt=\"drift_logo\" src=\"./documentation/drift_logo.png\" /\u003e\n\nA Websocket-Http Tunnel written in kotlin that lets you access any HTTP Api on servers deployed behind firewall(s)/Nat(s)/Proxy\n\n## What is drift?\nDrift lets you deploy any application anywhere and expose it on internet via a websocket-http tunnels. \nSo how does it look like?\n\n![drift architecture](documentation/drift_architecture.png)\n\n\n## How does it work ?\nPreconditions:\nYour client should have access to internet/drift server.\nThe drift client establishes a connection to the drift server over outbound http which is usually not blocked by firewalls.\nThe drift server then sends an upgrade, upgrading just established http connection to a websocket connection.\nNow your drift server is ready to accept incoming traffic and forward it to you app server deployed via the websocket connection.\n \n \n## Getting Started\nThe drift app can be run int following three modes:\n - SERVER\n - CLIENT\n - SERVER AND CLIENT\n \nThe applciation is published at docker as ```ankur4u007/drift```, so to run it as docker(easier for windows,\nlinux. For mac see [Running using docker on a mac](#using-docker-on-mac) below) you must have docker installed.\n\nIf you prefer `gradle` way of running things please refer to [Build and Run locally using gradle](#gradle-build) section.\n \nTo run as server: \n    ```docker run -it --net=host -e \"TUNNEL__SERVER__ENABLED=TRUE\" ankur4u007/drift```\n\nTo run as client: \n    ```docker run -it --net=host -e \"TUNNEL__CLIENT__ENABLED=TRUE\" ankur4u007/drift```\n\nTo run as both the server and client: \n    ```docker run -it --net=host -e \"TUNNEL__SERVER__ENABLED=TRUE\" -e \"TUNNEL__CLIENT__ENABLED=TRUE\" ankur4u007/drift```\n\n## \u003ca name=\"gradle-build\"\u003e\u003c/a\u003e Build and Run locally using gradle \nThe app is developed using spring reactive and can be easily build and run with `gradlew`\n - To build: ```./gradlew clean build```\n - To run locally: ```./gradlew clean run```.\n    - to run as client: simply set the value `tunnel.client.enabled` to `true` inside `src/main/resources/application.yml`\n    - to run as server: simply set the value `tunnel.server.enabled` to `true` inside `src/main/resources/application.yml`\n    - to run as both server and client, set both `tunnel.client.enabled` and `tunnel.server.enabled` to true.\n \n###  \u003ca name=\"build-docker-image\"\u003e Build using docker: \nAdditionally you can also build docker images after you have built with gradle. To do so simple run: \n```docker build --force-rm -t ankur4u007/drift .```\n\n##  \u003ca name=\"using-docker-on-mac\"\u003e Running using docker on a mac ?\nwell docker-for-mac doesn't yet fully support the ```--net=host``` mode, so the best option you have is to run either \neverything(drift client, drift server, and local app server) inside docker.\n\nLets say you are running an app inside docker that is hosted at port `80`.\ndocker ps output, assuming `determined_mestorf` is the app you deployed on `80` :\n```$xslt\n63ebcd34870a        filebrowser/filebrowser:v1.10.0   \"/filebrowser --conf…\"   3 hours ago         Up 3 hours          0.0.0.0:8001-\u003e80/tcp     determined_mestorf\n```\n Then you can simply run the drift client and server\nby running: \n```$xslt\ndocker run -it -e \"TUNNEL__SERVER__ENABLED=TRUE\" -e \"TUNNEL__CLIENT__ENABLED=TRUE\" -e \"TUNNEL__CLIENT__LOCALSERVER__URL=http://\u003c\u003cip:port of your app\u003e\u003e\" -p8080:8080 ankur4u007/drift\n```\nwhere `\u003c\u003cip:port of your app\u003e\u003e` is the ip with port of your container.\n\nDocker ps output for driver client server looks like:\n```$xslt\n265e7847c0f5        ankur4u007/drift                  \"/bin/sh -c 'sh /hom…\"   2 hours ago         Up 2 hours          0.0.0.0:8080-\u003e8080/tcp   wizardly_wright\n```\nNow you can ```hit http://localhost:8080``` to see the result.\n\n## Configurations\nThe drift server and app has a number of configurations available. Most of them are defaulted to some appropriate value.\nNeverthless they can be changed using environment variable.\nBelow are list of available configuration options that can be changed :\n```$xslt\nTUNNEL__SERVER__ENABLED: Flag to determine where to act as a server. Default value: false\nTUNNEL__SERVER__KEY: key value that needs to same accross server and client so that they can autheticate each other. Default value:`2b625f93-7006-47e2-a469-f41ec3dc7442 \nTUNNEL__SERVER__REMOTECLIENT_EVICTDURATIONINSEC: time till which a client session will be kept if not response from client is observerd. Default value: 120 \nTUNNEL__SERVER__REMOTECLIENT_TIMEOUTINSEC: timeout value for client requests. Once passed request would timeout and drift server would send ClientTimedOutException to caller. Default value: 60\nTUNNEL__CLIENT__ENABLED: Flag to determine where to act as a client. Default value: false\nTUNNEL__CLIENT__REMOTESERVER__URL: a websocket Url for deployed drift server. Default value: ws://localhost:8080\nTUNNEL__CLIENT__KEY: key value that needs to same accross server and client so that they can autheticate each other. Default value:`2b625f93-7006-47e2-a469-f41ec3dc7442\nTUNNEL__CLIENT__PING__DURATIONINSEC: time interval in seconds for within which client will ping server to indicate that it is alive. default value: 10\nTUNNEL__CLIENT__PING__DELAYINSEC: timey delay in seconds before the client sends the first ping to server. Default value: 1\nTUNNEL__CLIENT__PING__RECONNECTAFTERMAXMISSES: number of unsuccessful pings after which client will try to restablish the connection with the server. Default value: 10\nTUNNEL__CLIENT__LOCALSERVER__URL: Url of your app server where the drift client will forward incoming request from the drift server. Default value: http://localhost:8001 \nTUNNEL__CLIENT__LOCALSERVER__CONNECTTIMEOUTINSEC: connect timeout value for local server, drift client will timeout the request if your local server is unable to connect within this duration. Default value: 2\nTUNNEL__CLIENT__LOCALSERVER__READTIMEOUTINSEC: read timeout value for local server, drift client will timeout the request if your local server is unable to respond within this duration. Default value: 2\n```\nYou can also change the default port `8080` on which the server runs by changing the `server.port` value in `application.yml`.\nHowever if you do so don't forget to expose the same port in `Dockerfile` and rebuild the docker image for changes to take place.\nRefer [this](#build-docker-image) on how to build your docker image.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankur4u007%2Fdrift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankur4u007%2Fdrift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankur4u007%2Fdrift/lists"}