Whistle-Charles的輕量級替代品

個人感覺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,將信任中的使用此證書時選項改爲始終信任.

在這裏插入圖片描述

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章