1、将如下函数写到.bashrc
proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export proxy="http://127.0.0.1:7890"
#export proxy="socks5://127.0.0.1:7891"
export https_proxy=$proxy
export ftp_proxy=$proxy
export rsync_proxy=$proxy
export HTTP_PROXY=$proxy
export HTTPS_PROXY=$proxy
export FTP_PROXY=$proxy
export RSYNC_PROXY=$proxy
echo -e "已开启代理"
}
proxy_off(){
unset http_proxy
unset https_proxy
unset ftp_proxy
unset rsync_proxy
echo -e "已关闭代理"
}
2、测试,有东西显示就能用
curl google.com
网友评论