終端代理配置 開啟后每次打開終端都生效
function proxy_off(){
unset http_proxy
unset https_proxy
echo -e "已關閉代理"
}
function proxy_on() {
proxyopen
export http_proxy="http://127.0.0.1:1087"
export https_proxy=$http_proxy
echo -e "已開啟代理"
}
vim ~/.bash_profile
source ~/.bash_profile
具體的的代理連接配置你要根據自己使用的工具來定,譬如我使用的是 shadowscoket 上面有復制代理命令選項,拿來放到bash中即可。
curl ip.gs
這時看到的自己ip信息是在國內,但:
有時需要臨時代理才達到目的可以這樣操作:
export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087; curl ip.gs