{"id":9407276,"url":"https://github.com/tickbh/wmproxy","last_synced_at":"2025-04-14T05:54:10.246Z","repository":{"id":188863502,"uuid":"679214924","full_name":"tickbh/wmproxy","owner":"tickbh","description":"用Rust实现仿nginx，力争实现一个可替代方案，http/https代理, socks5代理, 负载均衡, 反向代理, 静态文件服务器，四层TCP/UDP转发，websocket转发, 内网穿透nat","archived":false,"fork":false,"pushed_at":"2024-11-22T08:59:24.000Z","size":647,"stargazers_count":482,"open_issues_count":8,"forks_count":73,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-07T03:01:40.887Z","etag":null,"topics":["expose","http-proxy","https-proxy","nat","proxy","socks","socks5","socks5-proxy","tunnel","websocket"],"latest_commit_sha":null,"homepage":"https://wmproxy.net","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tickbh.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":"2023-08-16T10:51:20.000Z","updated_at":"2025-04-05T02:26:02.000Z","dependencies_parsed_at":"2023-12-25T10:48:18.956Z","dependency_job_id":"b7fe3273-94cf-4332-befa-a6ff933c1017","html_url":"https://github.com/tickbh/wmproxy","commit_stats":{"total_commits":208,"total_committers":3,"mean_commits":69.33333333333333,"dds":"0.22115384615384615","last_synced_commit":"6088bd40e32cd5a743e426139ea4ad7acc47b6e4"},"previous_names":["tickbh/qyproxy","tickbh/wmproxy"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tickbh","download_url":"https://codeload.github.com/tickbh/wmproxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830390,"owners_count":21168272,"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":["expose","http-proxy","https-proxy","nat","proxy","socks","socks5","socks5-proxy","tunnel","websocket"],"created_at":"2024-05-10T18:05:01.973Z","updated_at":"2025-04-14T05:54:10.224Z","avatar_url":"https://github.com/tickbh.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# wmproxy\n[![crates.io](https://img.shields.io/crates/v/wmproxy.svg)](https://crates.io/crates/wmproxy)\n[![rustc 1.70.0](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://img.shields.io/badge/rust-1.70%2B-orange.svg)\n[![Released API docs](https://docs.rs/wmproxy/badge.svg)](https://docs.rs/wmproxy)\n\n`wmproxy`已用`Rust`实现`http/https`代理, `socks5`代理, 反向代理, 负载均衡, 静态文件服务器，`websocket`代理，四层TCP/UDP转发，内网穿透等\n\n## 📦 安装 \u0026 🏃 使用\n\n### 安装\n\n```bash\ncargo install wmproxy\n```\n\nOR\n\n```bash\ngit clone https://github.com/tickbh/wmproxy\ncd wmproxy\ncargo install --path .\n```\n\n```docker\ndocker pull dreamwhat/wmproxy\ndocker run -p 8090:8090 --name proxy_bash dreamwhat/wmproxy /bin/./wmproxy proxy -b 0.0.0.0:8090\n```\n\n### 使用\n默认端口为8090端口，默认监听地址为127.0.0.1\n```bash\n# 直接通用默认参数\nwmproxy proxy\n\n# 设置账号密码\nwmproxy proxy -b 0.0.0.0:8090 --user wmproxy --pass wmproxy\n\n# 其它指令\nwmproxy --help\n\n#配置文件版启动\nwmproxy config -c config/client.toml\n```\n\n##### 启动二级代理\n1. 在本地启动代理\n```bash\nwmproxy proxy -b 127.0.0.1:8090 -S 127.0.0.1:8091 --ts\n```\n或者\n```bash\nwmproxy config -c config/client.toml\n```\n配置文件如下:\n```toml\n[proxy]\n# 连接服务端地址\n#server = \"127.0.0.1:8091\"\nbind_addr = \"0.0.0.0:8090\"\nflag = \"http https socks5\"\n# 连接服务端是否加密\nts = true\ntwo_way_tls = true\n# username = \"wmproxy\"\n# password = \"wmproxy\"\n\n# 内网映射配置的数组\n\n  #将localhost的域名转发到本地的127.0.0.1:8080\n[[proxy.mappings]]\nname = \"web\"\nmode = \"http\"\nlocal_addr = \"127.0.0.1:8080\"\ndomain = \"localhost\"\n\nheaders = [\n  \"proxy x-forward-for {client_ip}\",\n  \"proxy + from $url\",\n  \"+ last-modified 'from proxy'\",\n  \"- etag\",\n]\n\n#将tcp的流量无条件转到127.0.0.1:8080\n[[proxy.mappings]]\nname = \"tcp\"\nmode = \"tcp\"\nlocal_addr = \"127.0.0.1:8080\"\ndomain = \"\"\n```\n\n因为纯转发，所以在当前节点设置账号密码没有意义`-S`表示连接到的二级代理地址，**有该参数则表示是中转代理，否则是末端代理。**```--ts```表示连接父级代理的时候需要用加密的方式链接\n\n2. 在远程启动代理\n```bash\nwmproxy proxy --user proxy --pass proxy -b 0.0.0.0:8091 --tc\n```\n或者\n```bash\nwmproxy config -c config/server.toml\n```\n配置文件如下:\n```toml\n[proxy]\n#绑定的ip地址\nbind_addr = \"127.0.0.1:8091\"\n\n#代理支持的功能，1为http，2为https，4为socks5\n# flag = \"7\"\nusername = \"wmproxy\"\npassword = \"wmproxy\"\n\n#内网映射http绑定地址\nmap_http_bind = \"127.0.0.1:8001\"\n#内网映射tcp绑定地址\nmap_tcp_bind = \"127.0.0.1:8002\"\n#内网映射https绑定地址\nmap_https_bind = \"127.0.0.1:8003\"\n#内网映射的公钥证书，为空则是默认证书\n# map_cert = \n#内网映射的私钥证书，为空则是默认证书\n# map_key =\n# 双向认证\ntwo_way_tls = true\n#接收客户端是为是加密客户端\ntc = true\n#当前服务模式，server为服务端，client为客户端\nmode = \"server\"\n```\n\n```--tc```表示接收子级代理的时候需要用加密的方式链接，可以```--cert```指定证书的公钥，```--key```指定证书的私钥，```--domain```指定证书的域名，如果不指定，则默认用自带的证书参数\n\u003e 至此通过代理访问的，我们已经没有办法得到真正的请求地址，只能得到代理发起的请求\n\n### 代理间的认证\n\u003e 目前提供了两种认证双式, ```two_way_tls```开启客户端的证书认证信息, 另一种服务端配置了```username```和```password```即需要客户端配置相同的用户密码才能启用认证信息, 两种方式可叠加使用或者单独使用。\n\u003e 配置添加如下:\n\n```yaml\nproxy:\n  two_way_tls: true\n  username: wmproxy\n  password: wmproxy\n```\n\n# 🚥 路线图\n### socks5\n\n- [x] IPV6 支持\n- [x] `SOCKS5` 验证方式\n  - [x] `NOAUTH`\n  - [x] `USERPASS`\n- [x] `SOCKS5` Commands\n  - [x] `CONNECT`\n  - [x] `UDP ASSOCIATE`\n\n### http/https\n\n- [x] IPV6 支持\n\n### 内网穿透\n\n- [x] Http 支持\n- [x] Https 支持\n- [x] Tcp 支持\n\n### 反向代理\n\n- [x] 静态文件服务器\n- [x] 被动健康检查\n- [x] 主动健康检查\n- [x] 配置热加载\n- [x] 负载均衡\n- [x] 四层TCP负载\n- [x] 四层UDP负载\n- [x] 流量控制\n- [x] websocket转发\n\n### 基础能力\n- [x] 日志\n\n#### 扩展能力\n\n- [x] 请求限速(limit_req)\n- [x] 修改 HTTP 请求 Header\n- [x] 支持 HTTP2 的内网穿透\n- [x] 控制微端\n- [x] try_paths\n- [x] tcp转websocket\n- [x] websocket转tcp\n\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=tickbh/wmproxy\u0026type=Date)](https://star-history.com/#tickbh/wmproxy\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftickbh%2Fwmproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftickbh%2Fwmproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftickbh%2Fwmproxy/lists"}