{"id":13813585,"url":"https://github.com/movsb/http2tcp","last_synced_at":"2025-07-28T21:08:58.878Z","repository":{"id":61624205,"uuid":"311674454","full_name":"movsb/http2tcp","owner":"movsb","description":"TCP over HTTP.","archived":false,"fork":false,"pushed_at":"2025-03-29T15:41:02.000Z","size":34,"stargazers_count":41,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T16:29:05.903Z","etag":null,"topics":["http","http-proxy","ssh","ssh-proxycommand","tcp","tcp-over-http"],"latest_commit_sha":null,"homepage":"https://blog.twofei.com/877/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/movsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-11-10T13:55:36.000Z","updated_at":"2025-03-29T15:41:06.000Z","dependencies_parsed_at":"2025-03-29T16:35:29.025Z","dependency_job_id":null,"html_url":"https://github.com/movsb/http2tcp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/movsb/http2tcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movsb%2Fhttp2tcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movsb%2Fhttp2tcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movsb%2Fhttp2tcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movsb%2Fhttp2tcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/movsb","download_url":"https://codeload.github.com/movsb/http2tcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/movsb%2Fhttp2tcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267585808,"owners_count":24111577,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["http","http-proxy","ssh","ssh-proxycommand","tcp","tcp-over-http"],"created_at":"2024-08-04T04:01:22.187Z","updated_at":"2025-07-28T21:08:58.845Z","avatar_url":"https://github.com/movsb.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# http2tcp\n\n**http2tcp** is a simple client \u0026 server program that turns an HTTP connection to a TCP connection.\n\nThis is kind of useful if you want to hide all ports traffic other than the standard well-known ports 80 and 443.\n\n## Usage\n\n```shell-session\n$ ./http2tcp -h\nUsage of http2tcp:\n  -s, --server               Run as server.\n  -c, --client               Run as client.\n  -l, --listen string        Listen address (client \u0026 server)\n  -e, --endpoint string      Server endpoint.\n  -d, --destination string   The destination address to connect to\n  -t, --token string         The token used between client and server\n  -h, --help                 Show this help\n```\n\nSome flags are shared between the client and server.\n\n### Example: Proxy SSH connections\n\nOn server:\n\n```shell-session\n$ ./http2tcp -s -t $TOKEN -l $SERVER_IP_OR_DOMAIN:2222\n```\n\nOn client:\n\n```shell-session\n$ ./http2tcp -c -d localhost:22 -e $SERVER_IP_OR_DOMAIN:2222 -t $TOKEN\nSSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3\n```\n\nNow the http2tcp client is connected to the SSH server running on the server side via an HTTP connection.\n\nIn your ssh_config, if you write the following:\n\n```ssh_config\nHost some-host\n\tProxyCommand http2tcp -c -d localhost:22 -e $SERVER_IP_OR_DOMAIN:2222 -t $TOKEN\n```\n\nYou can now SSH into your server via HTTP.\n\n### Multiple client connections\n\nThe client does support multiple connections, just make use of the `-l` flag.\n\n### Behind NGINX reverse proxy\n\nThis is actually the standard way to use HTTP2TCP.\n\n```nginx\nserver {\n\tserver_name example.com;\n\tlisten 443 ssl http2;\n\tlocation = /some-path/ {\n\t\tproxy_http_version 1.1;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header Upgrade $http_upgrade;\n\t\tproxy_set_header Connection \"Upgrade\";\n\t\tproxy_read_timeout 600s;\n\t\tproxy_pass http://localhost:2222/;\n\t}\n}\n```\n\nNow the `ProxyCommand` should be:\n\n```ssh_config\nProxyCommand http2tcp -c -d localhost:22 -e https://example.com/some-path/ -t $TOKEN\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovsb%2Fhttp2tcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmovsb%2Fhttp2tcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmovsb%2Fhttp2tcp/lists"}