{"id":37194594,"url":"https://github.com/haxii/socks-over-https","last_synced_at":"2026-01-14T22:37:37.380Z","repository":{"id":57520208,"uuid":"159636667","full_name":"haxii/socks-over-https","owner":"haxii","description":"convert a https proxy into socks5 proxy","archived":false,"fork":false,"pushed_at":"2018-12-01T04:20:41.000Z","size":14,"stargazers_count":101,"open_issues_count":4,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T15:55:52.214Z","etag":null,"topics":["proxy","socks5-proxy","tcp-tunnel"],"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/haxii.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}},"created_at":"2018-11-29T08:58:17.000Z","updated_at":"2024-06-03T09:36:16.000Z","dependencies_parsed_at":"2022-09-05T09:41:36.448Z","dependency_job_id":null,"html_url":"https://github.com/haxii/socks-over-https","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/haxii/socks-over-https","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxii%2Fsocks-over-https","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxii%2Fsocks-over-https/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxii%2Fsocks-over-https/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxii%2Fsocks-over-https/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haxii","download_url":"https://codeload.github.com/haxii/socks-over-https/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haxii%2Fsocks-over-https/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["proxy","socks5-proxy","tcp-tunnel"],"created_at":"2026-01-14T22:37:35.564Z","updated_at":"2026-01-14T22:37:37.364Z","avatar_url":"https://github.com/haxii.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# socks-over-https\n\nSOCKS5 proxy over HTTP tunnel, which simply coverts a certain HTTPS proxy (which doesn't prohibit `CONNECT` on non-443 port) into SOCKS5 proxy.\n\n```\n+--------+       +--------+        +-----------+      +--------+\n|        +-------\u003e socks5 +--------\u003e           +------\u003e        |\n| client |       | over   |        |https proxy|      | server |\n|        \u003c-------+ https  \u003c--------+           \u003c------+        |\n+--------+       +--------+        +-----------+      +--------+\n```\n\nIf you're looking for a transparent tcp proxy via http tunnel on Linux, try [transocks](https://github.com/cybozu-go/transocks) instead please.\n\n## Getting Started\n\n### Usage\n\n```bash\nsocks-over-https -h\n\n  -c string\n        config file (default \"config.json\")\n  -s string\n        Send signal to a master process: install, remove, start, stop, status (default \"status\")\n```\n\n### Configuration\n\nconfig file is defined as following json:\n\n```\n{\n  \"log\": {},\n  \"settings\": {},\n  \"proxies\": []\n}\n```\n\n1. log, Log configuration to control log outputs\n1. settings, Server internal parameters configuration\n1. proxies, socks \u0026 http proxy pairs\n\nthe proxy pair is configured as blow\n\n```\n{\n    \"socks\":{                  // socks5 server config\n        \"address\":\"127.0.0.1\", // socks5 server bind address, 127.0.0.1 by default\n        \"port\":10800,          // mandatory, socks5 server bind port, different from each server\n        \"user\":\"\",             // proxy username, no-auth by default\n        \"pass\":\"\"              // proxy password, no-auth by default\n    },\n    \"http\":{                   // http tunnel upstream config\n        \"address\":\"10.1.3.1\",  // mandatory, upstream http proxy hostname\n        \"port\":1080,           // mandatory, upstream http proxy port\n        \"user\":\"\",             // proxy username, no-auth by default\n        \"pass\":\"\"              // proxy password, no-auth by default\n    }\n}\n```\n\n## How It Works\n\nA typical HTTP proxy which can proxy HTTPS requests a.k.a. `HTTPS proxy` is mostly based on the [HTTP tunnel](HTTPS://en.wikipedia.org/wiki/HTTP_tunnel) by using the [CONNECT](HTTPS://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT) method of HTTP.\n\nFor example, a typical protocol of https proxy request to https://example.com/some/path is\n\n```\nCONNECT example.com:443 HTTP/1.1\nHost: example.com:443\nUser-Agent: some-user-agent\nProxy-Authorization: Basic dXNlcjpwYXNz\n```\n\nThe proxy will open a **TCP tunnel** to `example.com:443` for the client and return\n\n```\nHTTP/1.1 200 Connection established\n```\n\nThen any traffic sent to the proxy will be redirected to the **TCP tunnel** opened by proxy.\n\nWe can turn the **TCP tunnel** above for SOCKS5 protocol's tunnel. According to [RFC1928](https://www.ietf.org/rfc/rfc1928.txt), the protocol of socks5 proxy request to https://example.com/some/path with https tunnel is\n\n1) client sends the version identifier/method selection message to proxy\n\n```\nusing socks v5, using 3 auth methods: no auth, GSSAPI and username/password\n+-----+----------+----------+\n| VER | NMETHODS | METHODS  |\n+-----+----------+----------+\n| 0x05|   0x03   | 0x000102 |\n+-----+----------+----------+\n```\n\n2) server responds the version message\n\n```\nusing socks v5, using the no auth method\n+-----+--------+\n| VER | METHOD |\n+-----+--------+\n| 0x05|  0x02  |\n+-----+--------+\n```\n\n3) client sends the tunnel request to target server\n\n```\nCONNECT(CMD 1) to domain(ATYP 3) example.com with port 433\n+-----+-----+-----+------+-------------+----------+\n| VER | CMD | RSV | ATYP |  DST.ADDR   | DST.PORT |\n+-----+-----+-----+------+-------------+----------+\n| 0x05| 0x01| 0x00| 0x03 | example.com |   443    |\n+-----+-----+-----+------+-------------+----------+\n```\n\n4) server gets the request and connects to the remote https proxy, then respond to client\n\n- server connect to https proxy\n\n```\nCONNECT example.com:443 HTTP/1.1\nHost: example.com:443\nUser-Agent: some-user-agent\nProxy-Authorization: Basic dXNlcjpwYXNz\n```\n\n- remote proxy responds\n\n```\nHTTP/1.1 200 Connection established\n```\n\n- respond success (REP 0) to client\n\n```\n+-----+-----+------+------+----------+----------+\n| VER | REP |  RSV | ATYP | BND.ADDR | BND.PORT |\n+-----+-----+------+------+----------+----------+\n| 0x05| 0x00| 0x00 |  1   | 0.0.0.0  |   7648   |\n+-----+-----+------+------+----------+----------+\n```\n\n5) data transfer: Any traffic from client in written into http tunnel opened by proxy, any traffic from tunnel is written to client.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxii%2Fsocks-over-https","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaxii%2Fsocks-over-https","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaxii%2Fsocks-over-https/lists"}