Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)?

share|improve this question
1  
I think that the http_proxy variable is what you're looking for. Take a look in the Proxy Support howto. –  faif Mar 18 '11 at 8:28

3 Answers 3

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.

share|improve this answer

I agree that the best way to use the proxy server is with the environment variable http_proxy, as other answers have pointed out. Unfortunately, not all applications honour the http_proxy environment variable, which is why I still use tsocks for some programs to use LD_PRELOAD to force network connections to go through a SOCKS proxy.

share|improve this answer

There's no one-for-all solution. Each program uses its own way to connect to a proxy server.

I have a similar problem at my office. I found that best way to do this is to use a VPN connection. When you connect, the whole system network traffic will go through the VPN. If you don't have access to a VPN server, you can run a new one manually, and connect it to the proxy server you've got.

If you have an application that doesn't support proxy, you can use something like socksify, to wrap its network connection.

share|improve this answer
    
So you've tried this and failed? –  Tshepang Mar 18 '11 at 11:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.