个人感觉Whistle比Charles来说更改请求返回结果来说好用了很多,不过个人还是建议和PostMan、Charles等结合着用
安装
npm install -g whistle
启动
w2 start
[i] [email protected] started
[i] 1. use your device to visit the following URL list, gets the IP of the URL you can access:
http://127.0.0.1:8899/
http://xxx.xxx.xxx.xxx:8899/
http://xxx.xxx.xxx.xxx:8899/
http://xxx.xxx.xxx.xxx:8899/
Note: If all the above URLs are unable to access, check the firewall settings
For help see https://github.com/avwo/whistle
[i] 2. configure your device to use whistle as its HTTP and HTTPS proxy on IP:8899
[i] 3. use Chrome to visit http://local.whistlejs.com/ to get started
本机去操作界面的话就是去顶上的http://127.0.0.1:8899/
或http://local.whistlejs.com/
.其他设备通过外网ip进入需要设置防火墙.
重启升级等
# 运行
w2 start
# 重启
w2 restart
# 停止
w2 stop
# 帮助
w2 help
使用
Network
Network分页卡的使用和Charles差不多,就不说了.
Rules
Rules分页卡可以创建一些规则.双击规则,有"☑️"代表启用规则,无"☑️"代表不使用这个规则.
# 比如我在这个rule里头想修改如下请求地址的返回指定为Values里头定义的fileName
# url1
http://www.xx.com/xx/xx file://{fileName}
# url2
http://www.xx.com/xx/xx
Values
添加文件.文件名字可以在Rules中引用.
设置代理
点击HTTPS.然后扫码下载即可.(iOS证书安装我在下一篇文章里头再说).
点击顶上的download RootCA.然后在钥匙串中搜索stle
,将信任
中的使用此证书时选项改为始终信任
.