{"id":13827128,"url":"https://github.com/wuchangming/https-mitm-proxy-handbook","last_synced_at":"2025-04-05T16:04:02.647Z","repository":{"id":41067095,"uuid":"71036497","full_name":"wuchangming/https-mitm-proxy-handbook","owner":"wuchangming","description":"基于Node.js的HTTPS MITM(中间人)代理的原理和实现","archived":false,"fork":false,"pushed_at":"2017-01-29T12:02:57.000Z","size":4707,"stargazers_count":451,"open_issues_count":9,"forks_count":99,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-28T02:07:41.856Z","etag":null,"topics":["mitm","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/wuchangming.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":"2016-10-16T07:33:45.000Z","updated_at":"2025-03-15T09:23:27.000Z","dependencies_parsed_at":"2022-07-14T07:20:35.703Z","dependency_job_id":null,"html_url":"https://github.com/wuchangming/https-mitm-proxy-handbook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuchangming%2Fhttps-mitm-proxy-handbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuchangming%2Fhttps-mitm-proxy-handbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuchangming%2Fhttps-mitm-proxy-handbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuchangming%2Fhttps-mitm-proxy-handbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuchangming","download_url":"https://codeload.github.com/wuchangming/https-mitm-proxy-handbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361614,"owners_count":20926642,"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":["mitm","nodejs"],"created_at":"2024-08-04T09:01:50.658Z","updated_at":"2025-04-05T16:04:02.625Z","avatar_url":"https://github.com/wuchangming.png","language":"JavaScript","funding_links":[],"categories":["\u003ca id=\"42f9e068b6511bcbb47d6b2b273097da\"\u003e\u003c/a\u003e未分类"],"sub_categories":["\u003ca id=\"3bd67ee9f322e2c85854991c85ed6da0\"\u003e\u003c/a\u003e投毒\u0026\u0026Poisoning"],"readme":"# 基于Node.js的HTTPS [MITM](https://zh.wikipedia.org/wiki/%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB)(中间人)代理的原理和实现\n\n\u003cimg src=\"doc/img/hacker.png\" width=\"500px\"\u003e\n\n部署在公网的服务面临着越来越多的流量劫持、运营商劫持事件，为了能更好的保障信息的安全性和完整性，HTTPS得到了越来越多的重视。基于此原因，本文章尝试从另一个视角，通过使用[Node.js](http://nodejs.org/)实现一个简单的HTTPS中间人代理的方式，阐述HTTPS是如何保证网络信息的安全，并且分析用户的何种行将会导致HTTPS的安全性失效。  \n\n**[MITM](https://zh.wikipedia.org/wiki/%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB)（中间人）代理**的技术手段对于软件开发者并不陌生，在实际开发和测试中经常会使用。调试接口、查看HTTP请求与响应时使用的http抓包调试工具如：[Fiddler](http://www.telerik.com/fiddler)、 [Charles](https://www.charlesproxy.com/)，就是基于该原理实现的。  \n\n本文会更侧重于代码的实现，每一步都提供`详细的`、`可运行的`[js代码实现](./code)。\n\n#### 问题反馈\n\n如本文有原理上或者是代码层面的错误，再或者是任何方面的问题，都欢迎[提问](https://github.com/wuchangming/https-mitm-proxy-handbook/issues/new)或 Pull Request!\n\n\n#### 第〇节：[思路分析](./doc/Chapter0.md)\n\n#### 第一节：[HTTP中间人代理实现](./doc/Chapter1.md)\n\n#### 第二节：[如何代理HTTPS请求](./doc/Chapter2.md)\n\n#### 第三节：[HTTPS数字证书和数字证书链](./doc/Chapter3.md)\n\n#### 第四节：[一个简易的HTTPS代理](./doc/Chapter4.md)\n\n#### 第五节：[总结](./doc/Chapter5.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuchangming%2Fhttps-mitm-proxy-handbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuchangming%2Fhttps-mitm-proxy-handbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuchangming%2Fhttps-mitm-proxy-handbook/lists"}