I set up a proxy on Mac via System Preferences -> Network -> Advanced -> Proxies
.
Is that possible to do the same programatically via bash shell?
To do so, set the http_proxy and https_proxy variables, which tells the switch the address of the proxy server to use to fetch URLs on the command line. This is useful for programs such as apt / apt-get , curl and wget , which can all use this proxy. In a terminal, create a new file in the /etc/profile. d/ directory.
You can put this in your .profile
or .bash_profile
or run manually on a command line:
export http_proxy=http://proxy.server.com:@aproxy:portnumber
export https_proxy=https://proxy.server.com:@aproxy:portnumber
It's also common to not use the proxy for the local connections
export no_proxy=localhost,127.0.0.0/8,*.local
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With