Switch HTTP Proxy With Ease

Networking Mar 01, 2020

Assume you are heavily rely on Terminal interaction, whatever Bash or Zsh, if you wanna a quick switch from the console, you may try this.

Here is an example of using Zsh shell from your Linux distribution:

As the script mentioned, add it into ~/.zprofile, and type:

source ~/.zprofile

Then you can easily set the HTTP_PROXY/HTTPS_PROXY with one command:

set_http_proxy

Then follow the screen to set up your HTTP Proxy accordingly.

Somehow you need to switch off the proxy, simply use

unset_http_proxy

Last but not least, use kill_http_proxy to remove the stored HTTP Proxy config in your home folder.

Joshua Tu

ExcellentOps Advisory founder, ICT solution designer, CBAP certified business analyst, TOGAF certified enterprise architect.