Whistle is a cross-platform Web debugging agent based on a Node implementation that is more powerful than Fiddler and Charles

  • Official address: wproxy.org/whistle/

1. Install the plug-in

  • Install the node
  • Install whistle: NPM install -g whistle
  • Activation: w2 start | | whistle to start
  • W2 start -p 8888 (default port: 8899)
  • Restart: w2 restart
  • Stop: w2 stop

Access:http://127.0.0.1:8899/At this point, the installation is complete

2. Browser proxy

Download the Chrome Proxy plug-in: SwitchyOmega is recommended. Mobile proxies are not covered here

3. Install the certificate

Certificates need to be installed on both PC Download and mobile devices

4. The Host configuration

# host configuration10.911.20.*.test.com *.juejin.com # proxy local port aa.test.com127.0. 01.:10081# Local file proxyhttps://m.test.com/res/js/aa.js C:\xx\aa.js# Cross-domain configuration` * `Access-control-allow-origin: * reqCors Specifies the CORS used to modify the request. ResCors modify the returned CORS *. Test.com resCors:/ / *# ignore specifies rules such as: CDN image directly on lineignore://* img.test.com /aa/bb.json/i /other/test.json/iThe cookie field in the request header must contain test(case insensitive), and the URL must contain cgi-bin requests.//m:post includeFilter://h:cookie=test includeFilter:///cgi-bin/i
Copy the code

5. Mobile debugging

1. Inject vConsole into Whistle using the plug-in

npm i -g whistle.inspect

After successful installation, plugin will display:

Then configure the corresponding rule vconsole to take effect:

https://juejin.cn/ whistle.inspect://

2. Logs from the terminal are synchronized to the console of Whistle

baidu.com log://

3. Inject vConsole by inserting js scripts

JsPrepend ://{vconsole} aa.test.com jsPrepend://{vconsole.min.js}Copy the code

You can also insert styles

aa.test.com/i cssAppend://{myCSS}
Copy the code

6. More tips

  • The mock data
It can also match a list of file or directory paths, and whistle will look until it finds an existing file pattern TPL://queryList.json
pattern tpl://path1|path2|pathN
Copy the code