{"id":15826132,"url":"https://github.com/frigus02/go-tunneler","last_synced_at":"2025-04-01T09:50:28.337Z","repository":{"id":153282621,"uuid":"157621881","full_name":"frigus02/go-tunneler","owner":"frigus02","description":"A layer 4 reverse proxy, which forwards packets through an HTTP tunnel","archived":false,"fork":false,"pushed_at":"2018-11-15T23:38:41.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-06T09:43:18.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frigus02.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,"publiccode":null,"codemeta":null}},"created_at":"2018-11-14T22:53:25.000Z","updated_at":"2018-11-15T23:38:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"54945352-d237-44cc-b9a9-e54b1b66b798","html_url":"https://github.com/frigus02/go-tunneler","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/frigus02%2Fgo-tunneler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frigus02%2Fgo-tunneler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frigus02%2Fgo-tunneler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frigus02%2Fgo-tunneler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frigus02","download_url":"https://codeload.github.com/frigus02/go-tunneler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620267,"owners_count":20806721,"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":[],"created_at":"2024-10-05T09:43:10.894Z","updated_at":"2025-04-01T09:50:28.307Z","avatar_url":"https://github.com/frigus02.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Tunneler\r\n\r\n\u003e A layer 4 reverse proxy, which forwards packets through an HTTP tunnel\r\n\r\n**This is an example implementation and not production ready.**\r\n\r\n## Use case\r\n\r\nA client is deployed to an environment where it cannot connect to the server directly. It has to use an HTTP proxy. However the client application does not support HTTP proxies.\r\n\r\nA layer 7 reverse proxy, which works with the `Host` header, could be a solution. However it would need to terminate the TLS connection in order to read the header. Therefore the client application would have to trust the reverse proxy's certificate.\r\n\r\nAnother option is a layer 4 proxy. Change the DNS resolution of example.com to resolve to the IP of the Go Tunneler. Using SNI the Go Tunneler will figure out the destination server's hostname. It then opens an HTTP tunnel to a known proxy server and sends all TCP packets through the tunnel.\r\n\r\n```\r\n+-------------+\r\n|    Client   |\r\n+------+------+\r\n       |\r\n       | GET https://example.com (DNS: example.com -\u003e go-tunneler)\r\n       v\r\n+------+------+\r\n| Go Tunneler |\r\n+------+------+\r\n       |\r\n       | CONNECT example.com:443 HTTP/1.1 [then tunnel packets]\r\n       v\r\n+------+------+\r\n| HTTP Proxy  |\r\n+------+------+\r\n       |\r\n       | GET https://example.com\r\n       v\r\n+-------------+\r\n|   Server    |\r\n+-------------+\r\n```\r\n\r\n## Test this project\r\n\r\n1. Setup a local HTTP proxy (e.g. Fiddler)\r\n\r\n2. Add the following to your _hosts_ file:\r\n\r\n    ```\r\n    127.0.0.1 example.com\r\n    ```\r\n\r\n    Make sure the HTTP proxy can still correctly resolve the address. E.g. Fiddler has it's own hosts file option under the _Tools / HOSTS..._ menu.\r\n\r\n3. Start the to Go Tunneler:\r\n\r\n    ```sh\r\n    go run main.to -port 8443 -proxy 127.0.0.1:8888\r\n    ```\r\n\r\n4. Open your browser and go to https://example.com:8443\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrigus02%2Fgo-tunneler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrigus02%2Fgo-tunneler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrigus02%2Fgo-tunneler/lists"}