{"id":13606015,"url":"https://github.com/examplecode/mproxy","last_synced_at":"2025-12-18T06:52:31.120Z","repository":{"id":65467437,"uuid":"21041887","full_name":"examplecode/mproxy","owner":"examplecode","description":"c 语言实现的一个最小的http代理，支持翻墙","archived":false,"fork":false,"pushed_at":"2017-03-16T13:30:32.000Z","size":121,"stargazers_count":994,"open_issues_count":17,"forks_count":374,"subscribers_count":71,"default_branch":"master","last_synced_at":"2025-04-12T05:36:53.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/examplecode.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}},"created_at":"2014-06-20T15:06:50.000Z","updated_at":"2025-04-10T10:52:52.000Z","dependencies_parsed_at":"2023-01-25T09:00:50.451Z","dependency_job_id":null,"html_url":"https://github.com/examplecode/mproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/examplecode/mproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/examplecode%2Fmproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/examplecode%2Fmproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/examplecode%2Fmproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/examplecode%2Fmproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/examplecode","download_url":"https://codeload.github.com/examplecode/mproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/examplecode%2Fmproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27792864,"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-12-18T02:00:09.725Z","response_time":55,"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-01T19:01:05.221Z","updated_at":"2025-12-18T06:52:31.094Z","avatar_url":"https://github.com/examplecode.png","language":"C","funding_links":[],"categories":["C","\u003ca id=\"af9d2b4988d35a2a634c042a1c66bb8c\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"6e28befd418dc5b22fb3fd234db322d3\"\u003e\u003c/a\u003e翻墙"],"readme":"# mproxy 使用说明\n\n这是一个微型的http代理服务器实现,使用c语言实现，核心代码量不足500行,不依赖任何第三方的库(只能工作在unixlike系统下面).\n其主要功能如下：\n\n* http代理\n* 支持https隧道\n* 支持简单加密隧道\n\n注：本代码实现简陋，完成仓促，目前还停留在一个原型的阶段，经测试访问facebook,twitter,youtube ，google是OK的，但不保证所有的网站兼容性的问题，希望能够起到一个抛砖引玉的作用。欢迎提交pull request 继续完善. :)\n\n通常情况下存在两种工作模式,普通代理模式和加密隧道模式.\n\n## 普通代理\n\n这种工作模式和普通的http代理一样，mproxy目前只做简单的http转发，不做任何页面的缓存。\n\n## 加密隧道(翻墙专用)\n\n这种工作模式需要以client,server的模式进行配合使用，即mproxy分别作为客户端和服务端，并在客户端及服务端形成一个简单的加密隧道,从而躲过GFW的侦测。具体的工作模式如下图所示:\n\n \u003cpre\u003e   \n   +----------+        +-----------+       +----------+      +----------+\n   |          |        |           |       |          |      |          |\n   |          |        |           |       |          |      |          |\n   |  APP     +-------\u003e| mproxy    |+------\u003e mproxy   +------\u003e Web      |\n   |          |        |           |       |          |      |          |\n   |          |        | client    |       | server   |      |          |\n   +----------+        +-----------+       +----------+      +----------+\n\u003c/pre\u003e\n\n## 编译\n\nmproxy可以运行在unix-like 的操作系统下面，程序很小没有第三方的依赖，所以编译很简单，下面的一行命令搞定!\n\n    gcc -o mproxy mproxy.c\n\n\n## 使用方法\n\n### 作为普通的代理服务器。\n\n    ./mproxy -l 8000 -d\n\n这种工作方式对我们来讲意义不大，只做功能展示，重点在下面。\n\n注： \"-d\" 参数表示程序作为deamon服务，避免终端退出程序结束\n\n### 作为加密隧道的部署方式(翻墙专用)\n\n有翻墙需求的同学需要使用mproxy分别作为本地代理和远程代理，并且指定两个代理之间传输数据的方式为加密方式。 注：翻墙的话远程代理服务器需要部署在不受GFW管制的国外(找个便宜的VPS即可).\n\n#### step1 : 在远程服务器启动mproxy作为远程代理\n\n你需要把mproxy源码在远程的服务器编译(直接拷贝二进制应该也可以)然后运行下面的命令。\n\n    ./mproxy  -l 8081 -D -d\n\n-D 指定接受数据进行解密，其对应参数'-E'应用在本地代理\n-d 指定启动作为后台服务，避免终端退出程序结束\n\n#### step2 : 本地启动 mproxy 作为本地代理，并指定传输方式加密。\n\n在本地启动一个mporxy 并指定目上一步在远程部署的服务器地址和端口号。\n\n    ./mproxy  -l 8080 -h xxx.xxx.xxx.xxx:8081 -E\n\n-l 指定本地监听端口\n-h 指定远端下一跳步的服务器地址及端口号，如果翻墙需要是一台国外的服务器\n-E 发送数据的时候进行加密，其对应参数'-D' 应用在远程代理\n\n\n#### step3 : 配置浏览器http代理使用mporxy本地代理\n\n设置你的浏览器http代理指向你的本地代理，使用chrome浏览器的同学强烈推荐使用\n[switchSharp](https://github.com/feliscatus/switchyomega)，安装完毕swichSharp以后只需要为switchSharp增加一个情景模式就好，如下图：\n\n![设置switchSharp](./switchSharp_config.png) \n\n\n保存设置以后如果想翻墙的话就切换到你刚才配置的情景模式吧。\n\n![使用mproxy](./use_mproxy.png) \n\n\n注： mproxy暂不支持windows用户，但是可以和已经部署好的机器共享，只需要在switchSharp中把代理服务器的地址从“localhost\"改成已经部署好mproxy的ip即可。\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexamplecode%2Fmproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexamplecode%2Fmproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexamplecode%2Fmproxy/lists"}