设置终端代理
终端使用代理加速的正确方式(Clash) | Ln’s Blog
方便拉取项目,避免出现网络下载超时问题:
cat > ~/.bash_profile << EOF
function proxy_on() {
export http_proxy="http://127.0.0.1:7890"
export https_proxy="\$http_proxy"
echo -e "终端代理已开启。"
}
function proxy_off() {
unset http_proxy https_proxy
echo -e "终端代理已关闭。"
}
EOF
# 使配置生效
source ~/.bash_profile
开启代理:
proxy_on