{"id":13775658,"url":"https://github.com/gumblex/ptproxy","last_synced_at":"2025-08-10T22:32:47.128Z","repository":{"id":35791811,"uuid":"40072880","full_name":"gumblex/ptproxy","owner":"gumblex","description":"Turn any pluggable transport for Tor into an obfuscating TCP tunnel.","archived":false,"fork":false,"pushed_at":"2023-04-22T14:00:15.000Z","size":68,"stargazers_count":160,"open_issues_count":7,"forks_count":43,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-07T19:21:16.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/gumblex.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}},"created_at":"2015-08-02T08:02:55.000Z","updated_at":"2024-10-25T15:59:59.000Z","dependencies_parsed_at":"2022-09-04T03:10:18.926Z","dependency_job_id":"e663157e-1c86-4567-bdd0-429bdd2c66c9","html_url":"https://github.com/gumblex/ptproxy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gumblex/ptproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Fptproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Fptproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Fptproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Fptproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gumblex","download_url":"https://codeload.github.com/gumblex/ptproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Fptproxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269799281,"owners_count":24477630,"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-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2024-08-03T17:01:45.114Z","updated_at":"2025-08-10T22:32:47.084Z","avatar_url":"https://github.com/gumblex.png","language":"Python","funding_links":[],"categories":["\u003ca id=\"6e80463404d46f0493cf6e84597e4b5c\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"e99ba5f3de02f68412b13ca718a0afb6\"\u003e\u003c/a\u003eTor\u0026\u0026\u0026Onion\u0026\u0026洋葱"],"readme":"# PTProxy\n\nTurn any pluggable transport for Tor into an obfuscating TCP tunnel.\n\nThis script is compatible with PT protocol version 1 without Extended ORPort and is independent from Tor.\n\n    Client --\u003e PTProxy -(SOCKS5)-\u003e pt-client --.\n                                               |\n    Server \u003c-- pt-server(managed by PTProxy) \u003c-'\n\n## Usage\n\n`python3 ptproxy.py [-c|-s] [config.json]`\n\n* **Async version**: Please make sure your Python version is \u003e= 3.4\n* Install [aiosocks](https://github.com/nibrag/aiosocks/) first: `pip3 install aiosocks`\n* (Optional) supports `uvloop`\n\nThis async version has higher performance than the version using threads before. To be compatible with Python 3.2 or 3.3, `git checkout v1.0` to use the older version (implemented with threads)\n\n`-c|-s` is for overriding the `role` in the config file.\n\nThe JSON config file is explained below or in the head of `ptproxy.py`. It MUST NOT contain the comment lines. The file must be in UTF-8 encoding.\n\n**Experimental feature**: built-in SOCKS5 server. In the server-side config, set\n`\"local\"` to `\"socks5\"` (or `\"socks5 username password\"`).\n\n```\n{\n    // Role: client|server\n    \"role\": \"server\",\n    // Where to store PT state files\n    \"state\": \".\",\n    // For server, which address to forward\n    //   can be an IP or \"socks5\" for a built-in SOCKS5 proxy\n    // For client, which address to listen\n    \"local\": \"127.0.0.1:1080\",\n    // For server, which address to listen (must be an IP)\n    // For client, the server address to connect\n    \"server\": \"0.0.0.0:23456\",\n    // The PT command line\n    \"ptexec\": \"obfs4proxy -logLevel=ERROR -enableLogging=true\",\n    // The PT name, must be only one\n    \"ptname\": \"obfs4\",\n    // [Client] PT arguments\n    \"ptargs\": \"cert=AAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;iat-mode=0\",\n    // [Optional][Server] PT options\n    // \u003ckey\u003e=\u003cvalue\u003e [;\u003ckey\u003e=\u003cvalue\u003e ...]\n    \"ptserveropt\": \"\",\n    // [Optional][Client] Which outgoing proxy must PT use\n    // \u003cproxy_type\u003e://[\u003cuser_name\u003e][:\u003cpassword\u003e][@]\u003cip\u003e:\u003cport\u003e\n    \"ptproxy\": \"\"\n}\n```\n\nNote：When the server starts successfully, it will print out `ptargs`. Copy and paste this value to your client config file.\n\n## Note\n\nThis only operates as a TCP proxy. If you need a HTTP/SOCKS/etc. proxy, first install related softwares on the server.\n\nThe security or obfuscation provided fully depends on the Pluggable Transport you choose. This script is only a wrapper, and is provided AS IS with ABSOLUTELY NO WARRANTY.\n\n----------\n\n# PTProxy\n\n将任何用于 Tor 的传输插件做成 TCP 混淆隧道。\n\n这个脚本兼容 Tor 传输插件协议版本 1，不支持 Extended ORPort。该脚本独立于 Tor。\n\n    Client --\u003e PTProxy -(SOCKS5)-\u003e pt-client --.\n                                               |\n    Server \u003c-- pt-server(managed by PTProxy) \u003c-'\n\n## 用法\n\n`python3 ptproxy.py [-c|-s] [config.json]`\n\n* **异步版本**: 请确保 Python 版本 \u003e= 3.4\n* 请先安装 [aiosocks](https://github.com/nibrag/aiosocks/): `pip3 install aiosocks`\n* （可选）支持 `uvloop`\n\n该异步版本比之前使用线程的版本性能更高。如果要兼容 Python 3.2 或 3.3， `git checkout v1.0` 来使用旧版本（用线程实现）\n\n使用 `-c|-s` 参数可覆盖配置文件中 `role` 的值。\n\n以下是对 JSON 配置文件的解释（在 `ptproxy.py` 的头部也有）。配置文件中**不能**包含注释行，必须使用 UTF-8 编码。\n\n**实验性功能**: 内置 SOCKS5 服务器。在服务端配置中，将\n`\"local\"` 设置为 `\"socks5\"` （或 `\"socks5 username password\"`）。\n\n```\n{\n    // 指定工作模式: client|server 客户端或服务器\n    \"role\": \"server\",\n    // 传输插件状态文件储存位置\n    \"state\": \".\",\n    // 对于服务器，指定要转发的地址\n    //   可以是 IP，或可以是 \"socks5\" 来打开内置 SOCKS5 代理\n    // 对于客户端，指定本地监听地址\n    \"local\": \"127.0.0.1:1080\",\n    // 对于服务器，指定服务端监听地址\n    // 对于客户端，指定要连接的服务端地址\n    \"server\": \"0.0.0.0:23456\",\n    // 传输插件的命令行\n    \"ptexec\": \"obfs4proxy -logLevel=ERROR -enableLogging=true\",\n    // 传输插件名称，只能有一个\n    \"ptname\": \"obfs4\",\n    // [客户端] 传输插件的参数\n    \"ptargs\": \"cert=AAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;iat-mode=0\",\n    // [可选][服务端] 传输插件的选项\n    // \u003c键\u003e=\u003c值\u003e [;\u003c键\u003e=\u003c值\u003e ...]\n    \"ptserveropt\": \"\",\n    // [可选][客户端] 传输插件前置代理\n    // \u003c代理类型\u003e://[\u003c用户名\u003e][:\u003c密码\u003e][@]\u003cIP\u003e:\u003c端口\u003e\n    \"ptproxy\": \"\"\n}\n```\n\n注意：服务端成功启动后，会输出 `ptargs` 参数。请复制粘贴该值到客户端配置文件。\n\n## 注意\n\n这个项目仅能作为 TCP 连接代理。如果你需要一个 HTTP/SOCKS 等代理，请先在服务器上安装相应的软件。\n\n该脚本提供的安全性或混淆程度完全依赖于你选用的传输插件，它只作为一层包装。该脚本“依样”提供，**不做任何担保**。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumblex%2Fptproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgumblex%2Fptproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumblex%2Fptproxy/lists"}