First, develop pain points

When I choose the proxy tool, I am attracted to “whether the proxy can support HTTPS requests”, “whether the configuration items are simple and convenient”, “whether it can meet my proxy needs” and “whether the interface meets my aesthetic taste”. If you have those concerns, go for Whistle and you won’t be disappointed.

2. Introduction to Whistle

Whistle is a cross-platform packet capture tool that supports Windows, Mac, and Linux. It can configure proxies, capture HTTPS requests, simulate mock interface data, redirect requests, modify request header response headers, modify PARAMETERS of GET requests, and inject JS and CSS into pages. It is an iterative process, and maintainers are responsive to the community’s concerns. The interface is as follows:

3. Whistle installation and startup

  • Install Node.js: If not, install it yourself
  • NPM install -g whistle
  • Run the whistle start or w2 start command

  • Type in http://127.0.0.1:8899/ or local.whistlejs.com/
  • If you see a packet capture interface, the installation and startup are successful

Install the Whistle Agent (SwitchyOmega Chrome Extension).

  • To access the link, click “Add to CHROME”
  • Configure the proxy as prompted

Scenario mode name can be customized, proxy server parameters as shown in the figure, the address list of non-proxy cleared, after configuration click the left “Application options”

  • Select the configured agent: switch to Whistle by clicking the circle icon in the upper right corner of Chrome

  • When the whistle interface is opened by typing local.whistlejs.com into the browser, SwitchyOmega is configured correctly

5. Support fetching HTTPS configuration

  • A certificate needs to be installed on the PC. If you choose HTTPS in the upper navigation, the following interface is displayed. Select the following two items and click Download RootCA to Download the certificate, add the certificate, and set the trusted state of the PC
  • Add certificate encountered problems, such as certificate is not trusted, solution: enter the “key access” -> find the certificate -> double click or right click “Show profile” -> open “Trust” -> choose “always Trust”

6. Common configuration items

1 with the host

  • To map Baidu.com to 127.0.0.1, you go to www.baidu.com and ask for a local 127.0.0.1
  • You can also bring ports
  • It can also be a specified path

2 the redirection

Redirect www.baidu.com/ to www.qq.com/

3 Replace the requested data

  • Replace local data: for example, we want to simulate local interface data, etc.
  • You can simply replace it with a local JSON file

  • You can put it in the Values that come with Whistle

A whistle doesn’t automatically add content-Type: application/json to Response Headers if it doesn’t end in. Json. Charset = utF-8, please use the.json ending file

4 Modify the return status code

5 Modify the returned status and data

6 Replace online files or urls

7 Modify the header information of a request or response

You can use the Values that come with whistle to simulate the request and response headers. The keyword of the response header is resHeaders, and the keyword of the request header is reqHeaders.

Nine other

There are also many functions, such as js insertion, options processing, mobile terminal capture and so on, the community has been maintaining, for the problems, also actively reply, try it and love it.