Proxy

引言:阿里开源功能强大的代理服务器,可用于移动端测试抓包等操作。

01. 简介

JavaScript

02. 安装

$ brew update
$ brew install node
$ node --version
# 安装稳定正式版
$ npm install -g anyproxy
# 最新测试版,需要使用最新版本 node 进行安装
$ npm install -g anyproxy@beta
# 有时需要添加 sudo
代理服务器 AnyProxy
$ anyproxy

03. 配置 Https

# 稳定版本生成方法
$ sudo anyproxy --root
# 最新版本生成方法
$ anyproxy-ca
$ anyproxy --intercept
# 简写
$ anyproxy -i

04. 其他

$ npm uninstall anyproxy
$ anyproxy --clear

05. 规则文件

// 允许 Https 解析
module.exports = {

    shouldInterceptHttpsReq : function(req){
        return true;
    }

};
$ anyproxy --rule ./rule.js
# 直接请求服务器
$ curl https://github.com
# 通过代理服务器请求
$ curl https://github.com --proxy http://127.0.0.1:8001
$ anyproxy --rule https://sample.com/rule.js

06. 拓展

07. Electron 封装 AnyProxy

electron_anyproxy
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。