klren0312 / daliy_knowledge

知识积累,正确使用方式是watch
21 stars 4 forks source link

zsh添加代理 #834

Open klren0312 opened 5 months ago

klren0312 commented 5 months ago

1. 修改 ~/.zshrc

function proxy_on() {
  export http_proxy="http://127.0.0.1:7890/"
  export https_proxy=$http_proxy
  export all_proxy=socks5://127.0.0.1:7890
  echo -e "open proxy"
}

function proxy_off() {
  unset http_proxy
  unset https_proxy
  echo -e "close proxy"
}

2. 执行修改

source ~/.zshrc
# 开启代理
proxy_on