Skip to content

Instantly share code, notes, and snippets.

@jackyshan
Created July 11, 2017 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackyshan/cb2383adb60669005c53f19e43008c1e to your computer and use it in GitHub Desktop.
Save jackyshan/cb2383adb60669005c53f19e43008c1e to your computer and use it in GitHub Desktop.
终端代理
给 iTerm 终端设置代理
1.设置代理
使用 curl,wget,brew等http应用程序会调用http_proxy和https_proxy这两环境变量进行代理,通过下面方式设置:
export http_proxy=http://127.0.0.1:8087
export https_proxy=$http_proxy
2.取消设置
unset http_proxy https_proxy
3.快速切换
可以在 ~/.zshrc 或者 ~/.bash_profile 中添加这样的alias:
alias goproxy='export http_proxy=http://127.0.0.1:8087 https_proxy=http://127.0.0.1:8087'
alias disproxy='unset http_proxy https_proxy'
这样下次就可以很方便地切换proxy了!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment