Way to set network proxy system-wide

http-proxynetworking

If I want to have GNOME applications (as well as Firefox and Chrome) access the network through a proxy, I need only use gnome-network-properties (a nice and simple GUI I must say). For other apps (e.g. APT, Transmission, XChat), I have to use their specific ways of doing it.

Is there a way to avoid this, something I can turn on and off when in a network that requires a proxy (hostname:port)?

Best Answer

I think pretty much all linux/unix software that uses networking will honor the http_proxy and ftp_proxy environment variables. Depending on how your distribution is set up, /etc/environment will exist and be read by default by login shells.

You can add a line saying

http_proxy=123.45.67.89:1011

in /etc/environment easily enough, but changes in that file will only take hold the next time you start a shell process -- and only in that shell process. I don't think you can modify global variables in a shell other than your current one.

Related Question