Front-end development agent configuration

Proxy configuration

As a development and debugging tool, Whistle can help developers solve many problems, such as: cross-domain, different environment configurations, and so on.

The principle of agency

a.jpg

Whistle

For detailed configuration, please refer to

installation

Whistle is based on Node.js. Need to install Node.js first (version needs to be greater than 10.0)

npm install -g whistle

Start command

start up whistle start

Restart w2 restart(you can directly use this to start)

access

http://127.0.0.1:8899/

Rule

Configure Rule, this is a more important step, the purpose is to forward access to a certain 特定域名的请求interception 本地服务器.

Visit, http://127.0.0.1:8899/#rules, the configuration is as follows.

There are many ways to configure rules

1. Exact match

Note: When accessed http://ltzero.com/test/js/app.js, it will be forwarded by the proxy server tohttp://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

2. Regular matching

Example 2
# 以 / 开头  / 结尾
/http://ltzero.com/test/js/(.*\.(js))/ http://127.0.0.1:8080/test/js/$1

$1为占位符,可以拿到前面通过正则匹配到的第一个结果。
此正则配置,包含了上面的示例1

3. Wildcard matching

Example 3
# 以 ^ 开头
^ltzero.com/test/*** http://127.0.0.1:8080/$1

4…

For more matching rules, refer to the official configuration rules

SwitchyOmega

Proxy configuration extension tool used by Chrome.

1. Create a new profile

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

2. Switch browser's Proxy SwitchyOmega

Computer agent

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

Win10 configuration global proxy

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

Address 127.0.0.1, port8899

Mac

Official address

Mobile agent

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

Set wifi proxy->manually, computer's internal network IP 10.1.10.133, port8899

Guess you like

Origin blog.csdn.net/LitongZero/article/details/115331890