{"id":26282022,"url":"https://github.com/chainreactors/proxyclient","last_synced_at":"2026-03-18T02:33:05.610Z","repository":{"id":272773059,"uuid":"914225645","full_name":"chainreactors/proxyclient","owner":"chainreactors","description":"golang styles proxy client, support http/https, socks4/5, ssh","archived":false,"fork":false,"pushed_at":"2025-04-14T15:53:30.000Z","size":162,"stargazers_count":38,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T07:41:33.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://chainreactors.github.io/wiki/libs/proxyclient/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainreactors.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,"zenodo":null}},"created_at":"2025-01-09T07:25:05.000Z","updated_at":"2025-05-04T09:31:39.000Z","dependencies_parsed_at":"2025-01-16T15:27:20.324Z","dependency_job_id":"db85136d-5b66-4c53-96c7-0965665f7dbf","html_url":"https://github.com/chainreactors/proxyclient","commit_stats":null,"previous_names":["chainreactors/proxyclient"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/chainreactors/proxyclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fproxyclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fproxyclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fproxyclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fproxyclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainreactors","download_url":"https://codeload.github.com/chainreactors/proxyclient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainreactors%2Fproxyclient/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262547161,"owners_count":23327116,"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":"2025-03-14T16:19:15.665Z","updated_at":"2026-03-18T02:33:05.594Z","avatar_url":"https://github.com/chainreactors.png","language":"Go","readme":"# ProxyClient\n\n一个功能强大的代理客户端库，支持多种代理协议。本项目重构自 [github.com/RouterScript/ProxyClient](https://github.com/RouterScript/ProxyClient)。\n\nblog posts:\n\n- https://chainreactors.github.io/wiki/blog/2025/02/14/proxyclient-introduce/\n\n## 支持的协议\n\n- [x] Direct - 直连模式\n- [x] Reject - 拒绝连接\n- [x] Blackhole - 黑洞模式\n- [x] HTTP - HTTP 代理\n- [x] HTTPS - HTTPS 代理\n- [x] SOCKS5 - SOCKS5 代理\n- [x] ShadowSocks - ShadowSocks 代理\n- [x] SSH Agent - SSH 代理\n- [x] Suo5 - Suo5 协议\n- [x] Neoreg - Neoreg 协议\n\n## 基本使用\n\n### 快速开始\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"github.com/chainreactors/proxyclient\"\n)\n\nfunc main() {\n\t// 创建代理URL\n\tproxy, _ := url.Parse(\"http://localhost:8080\")\n\n\t// 创建代理客户端\n\tdial, _ := proxyclient.NewClient(proxy)\n\n\t// 创建HTTP客户端\n\tclient := \u0026http.Client{\n\t\tTransport: \u0026http.Transport{\n\t\t\tDialContext: dial.Dial,\n\t\t},\n\t}\n\n\t// 发送请求\n\tresp, err := client.Get(\"http://www.example.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\t// 读取响应\n\tcontent, _ := ioutil.ReadAll(resp.Body)\n\tfmt.Println(string(content))\n}\n```\n\n### Example\n\n#### Curl \n\n模拟 curl 命令，通过代理访问指定的 URL。\n\n```bash\ngo build ./example/curl\ncurl \u003cproxy-url\u003e \u003ctarget-url\u003e\n\n# 示例\n./curl http://127.0.0.1:8080 https://example.com\n```\n\n#### NC \n\n模拟 nc 命令，通过代理连接指定的主机和端口。\n\n```bash\ngo build ./example/nc\n./nc \u003cproxy-url\u003e \u003ctarget-host\u003e \u003ctarget-port\u003e\n\n# 示例\n./nc http://127.0.0.1:8080 example.com 80\n```\n\n#### SOCKS5 \n\n在本地启动一个 SOCKS5 服务器，将所有流量通过上游代理转发。\n\n```bash\ngo build ./example/socks5\n./socks5 \u003cproxy-url\u003e \u003clisten-addr\u003e\n\n# 示例\n./socks5 http://127.0.0.1:8080 :1080\n```\n\n## 协议配置说明\n\n### HTTP/HTTPS\n\nHTTP 和 HTTPS 代理支持基本认证。\n\n```\n格式：http(s)://[username:password@]host:port\n参数：\n- username: 认证用户名\n- password: 认证密码\n- host: 代理服务器地址\n- port: 代理服务器端口\n\n示例：\nhttp://user:pass@127.0.0.1:8080\nhttps://127.0.0.1:8443\n```\n\n### SOCKS5\n\n支持无认证和用户名密码认证两种方式。\n\n```\n格式：socks5://[username:password@]host:port\n参数：\n- username: 认证用户名（可选）\n- password: 认证密码（可选）\n- host: 代理服务器地址\n- port: 代理服务器端口\n\n示例：\nsocks5://127.0.0.1:1080\nsocks5://user:pass@127.0.0.1:1080\n```\n\n### ShadowSocks\n\n支持多种加密方式。\n\n```\n格式：ss://method:password@host:port\n参数：\n- method: 加密方式，支持：aes-256-gcm, chacha20-ietf-poly1305等\n- password: 密码\n- host: 服务器地址\n- port: 服务器端口\n\n示例：\nss://aes-256-gcm:password@127.0.0.1:8388\n```\n\n### Suo5\n\nSuo5 协议支持多种参数配置。\n\n```\n格式：suo5(s)://host:port/path?param1=value1\u0026param2=value2\n参数：\n- timeout: 连接超时时间，如：5s\n- retry: 重试次数，默认10\n- interval: 读写间隔，如：100ms\n- buffer_size: 缓冲区大小，默认32KB\n\n示例：\nsuo5://example.com:8080/tunnel?timeout=10\u0026retry=5\nsuo5s://example.com:8443/tunnel?interval=200ms\n```\n\n### Neoreg\n\nNeoreg 协议支持丰富的参数配置。\n\n```\n格式：neoreg(s)://key@host:port/path?param1=value1\u0026param2=value2\n参数：\n- key: 连接密钥（必需）\n- timeout: 连接超时时间，如：5s\n- retry: 最大重试次数，默认10\n- interval: 读写间隔，如：100ms\n- buffer_size: 读取缓冲区大小，默认32KB\n\n示例：\nneoreg://password@example.com:8080/tunnel?timeout=10s\nneoregs://password@example.com:8443/tunnel?interval=200ms\u0026retry=5\n```\n\n### 注意事项\n\n- 对于需要 TLS 的协议，可以通过在协议名后添加's'来启用：`https://`, `suo5s://`, `neoregs://`\n- 部分协议支持通过 URL 参数进行高级配置\n\n## 参考\n\n- [GameXG/ProxyClient](https://github.com/GameXG/ProxyClient)\n- [RouterScript/ProxyClient](https://github.com/RouterScript/ProxyClient)\n\n## Build tags for optional protocols\n\nTo reduce binary size, `SSH` and `Shadowsocks` are optional now.\n\n- Enable `SSH` support: `-tags proxyclient_ssh`\n- Enable `Shadowsocks` support: `-tags proxyclient_shadowsocks`\n- Enable both: `-tags \"proxyclient_ssh proxyclient_shadowsocks\"`\n\nDefault build does not include these two protocol implementations.\nWhen disabled, `ssh://` and `ss://` are not registered and\n`NewClient` returns `unsupported proxy client.`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainreactors%2Fproxyclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainreactors%2Fproxyclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainreactors%2Fproxyclient/lists"}