Skip to content

Instantly share code, notes, and snippets.

@ysrotciv
Created June 10, 2018 10:20
Show Gist options
  • Select an option

  • Save ysrotciv/2fcad712538dc1002a750e313553a741 to your computer and use it in GitHub Desktop.

Select an option

Save ysrotciv/2fcad712538dc1002a750e313553a741 to your computer and use it in GitHub Desktop.
http_proxy switch functions
function proxy_off(){
unset http_proxy
unset https_proxy
brew services stop polipo
echo -e "已关闭代理"
}
function proxy_on() {
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
export http_proxy="http://127.0.0.1:8123"
export https_proxy=$http_proxy
brew services start polipo
echo -e "已开启代理"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment