终端代理设置

81 阅读1分钟

终端代理设置

.bashrc | .zshrc

url=http://127.0.0.1:8080
alias poff='unset http_proxy;unset https_proxy'
alias pon='export http_proxy=$url; export http_proxy=$url;'

检查代理是否开启

curl ipinfo.io                                                                                                                                            [21/03/17| 4:21PM]
{
  "ip": "119.28.51.175",
  "city": "Kowloon",
  "region": "Kowloon City",
  "country": "HK",
  "loc": "22.3167,114.1833",
  "org": "AS132203 Tencent Building, Kejizhongyi Avenue",
  "timezone": "Asia/Hong_Kong",
  "readme": "https://ipinfo.io/missingauth"
}