在~/.zshrc
配置文件中添加下面一段,以后使用的时候直接输入proxy
打开代理模式,关闭代理事输入noproxy
即可。
vim ~/.zshrc
# where proxy
proxy () {
export http_proxy="https://127.0.0.1:7890"
export https_proxy="https://127.0.0.1:7890"
echo "HTTP Proxy on"
}
# where noproxy
noproxy () {
unset http_proxy
unset https_proxy
echo "HTTP Proxy off"
}
由于本人使用的Clash X
的软件作为代理,所以默认代理端口为7890
,如果使用其他代理请注意端口。
评论 (0)