Proxy configuration

Whistle is a development and debugging tool that can help developers solve many problems, such as cross-domain, different environment configurations, and more.

Principle of agency

Whistle

For details, see

The installation

Whistle is based on Node.js. Node.js needs to be installed (version larger than 10.0)

npm install -g whistle
Copy the code

Start the command

Start the whistle start

W2 restart w2 restart

access

http://127.0.0.1:8899/

Rule

Configuring a Rule is an important step to block and forward requests to a specific domain name to the local server.

To access http://127.0.0.1:8899/#rules, the configuration is as follows:

Rules can be configured in many ways

1. Exact match

Note: when visiting http://ltzero.com/test/js/app.js, will be a proxy server forwarding to http://127.0.0.1:8080/test/js/app.js

Example 1
http://ltzero.com/test/js/app.js http://127.0.0.1:8080/test/js/app.js
Copy the code

2. Regular matching

Example 2
# end begin with / / / http://ltzero.com/test/js/ (. * \. (js))/http://127.0.0.1:8080/test/js/$1 $1 for a placeholder, can get the front through regular match to the first result. This re configuration contains example 1 aboveCopy the code

3. The wildcard matches

Example 3
# begin with ^ ^ ltzero.com/test/ * * * http://127.0.0.1:8080/$1Copy the code

4…

For more matching rules, see official Configuration Rules

SwitchyOmega

Chrome proxy configuration extension tool.

1. Create a scenario mode

Proxy server -> Proxy protocol, select HTTP in the drop-down box, change example.com to 127.0.0.1, and change 80 to 8899

2. Switch Proxy SwitchyOmega of the browser

Computer agent

After the global proxy is configured on the computer, all applications will use the proxy.

Win10 configure global proxy

Win key -> Settings -> Network and Internet-> Proxy -> Manually set proxy.

Address 127.0.0.1, port 8899

Mac

The official address

Mobile agent

After the mobile phone is configured with proxy, all application requests go through proxy.

Set wifi proxy -> manual, Intranet IP10.1.10.133, port 8899