AnyProxy 介绍
AnyProxy 是一个基于 Node.js
的代理服务器。代理服务器是个中间人,站在了客户端和服务端中间,双方通信的每个比特,都会滴水不漏地经过它。它控制了完整的请求头、请求体、响应头、响应体,可以在客
户端与服务端都无感知的情况下介入处理所有的流程。只要代理服务器可以实现灵活配置,前端工程师们的奇葩需求就有出头之日了。
特性:
-
支持 https 明文代理
-
支持低网速模拟
-
支持二次开发,可以用 javascript 控制代理的全部流程,搭建前端个性化调试环境
-
提供web版界面,观测请求情况
示例代码:
var proxy = require("anyproxy"); //create cert when you want to use https features //please manually trust this rootCA when it is the first time you run it! proxy.isRootCAFileExists() && proxy.generateRootCA();var options = { type : "http", port : 8001, hostname : "localhost", rule : require("path/to/my/ruleModule.js"), dbFile : null, // optional, save request data to a specified file, will use in-memory db if not specified webPort : 8002, // optional, port for web interface socketPort : 8003, // optional, internal port for web socket, replace this when it is conflict with your own service webConfigPort : 8088, // optional, internal port for web config(beta), replace this when it is conflict with your own service throttle : 10, // optional, speed limit in kb/s disableWebInterface : false, //optional, set it when you don't want to use the web interface silent : false //optional, do not print anything into terminal. do not set it when you are still debugging. };new proxy.proxyServer(options);
AnyProxy 官网
https://github.com/alibaba/anyproxy
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。