linux terminal agent and mac

Outline

Today, we found that local services can not be over the wall and look for the next reason is because small plane on a linux system even opened a global proxy agent terminal or not , need to open the terminal agent job. Way I recorded the time reference for future development, I believe it is useful to others.

NOTE: This method applies only to linux / mac system, and opened a small plane. ( Terminal proxy means, when the server needs to send http request in the terminal, not over the wall, even opened a small plane useless, this time to give the terminal settings proxy settings on small aircraft)

View terminal ip

Use curl ip.gs view local ip:

curl ip.gs

// 输出如下
Current IP / 当前 IP: xxx.xx.xxx.xx
ISP / 运营商:  ChinaTelecom
City / 城市: Shenzhen Guangdong
Country / 国家: China

We can see, ip terminal is China's ip.

View small plane http proxy settings

Open the small plane, click http proxy settings, you can see:

http 代理监听地址:127.0.0.1
http 代理监听端口:1087

Set up

In the terminal to enter the following command:

export http_proxy=http://127.0.0.1:1087
export https_proxy=http://127.0.0.1:1087

View terminal ip

Check terminal ip again:

curl ip.gs

// 输出如下
Current IP / 当前 IP: xxx.xx.xxx.xx
ISP / 运营商:  igene.tw
City / 城市: Hong Kong
Country / 国家: China

You can see, the city has become Hong Kong, it indicates that the agent was successful.

Close the terminal agent

Further, the command is to close the agent terminal:

unset http_proxy;unset https_proxy

Close to the terminal or directly.

Guess you like

Origin www.cnblogs.com/yangzhou33/p/11495535.html