Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Our campus employs proxy server with authentication.

So, I have to apply http://username:password@proxyIp:port/ bash configure file(suppose for wget or curl) or manually entering details for every graphical application (like gtalk), and also if I work with localhost (XAMPP),

I have to configure XAMPP, and so on. If I have my proxy password changed I have to change it everywhere on the system! Is there a way I can apply proxy settings system-wide at one place.Even though I am asking for Linux, I would like to know it on windows also.

share|improve this question

migrated from stackoverflow.com Nov 26 '11 at 16:24

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

Usually the http_proxy enviroment variable can be set to configure the proxy settings and all applications should read that variable but it is not mandatory for them to do.

The http_proxy setting can be set in $HOME/.bashrc or similar.

share|improve this answer
    
But that doesn't apply to, for example a server running on localhost. If I am testing a website locally which will get some information from internet, it wouldn't connect.Well bash applies to many but not all! –  Sravan Nov 28 '11 at 16:02
add comment

There is no such thing as global proxy configuration on Linux. Some applications may respect the http_proxy environment variable, depending on the network/HTTP library they use, others will not.

Background

On Linux – contrary to for example Windows – there are a range of libraries that initiate HTTP connections like cURL, etc. To the operating system (the kernel) only sees a bunch of TCP connections going to all over the world. On Windows most applications rely on the HTTP library that came with Internet Explorer and the rest adapted to take advantage of those settings too.

The Linux world has never "evolved" a central place to configure proxy servers, so there simply is no way to enforce the usage of a specific proxy server short of redirecting all network traffic in the firewall.

Practical advice

You may achieve the best result setting the http_proxy variable as early in the process tree as possible. Depending on your Linux distribution you will have to look up the specific place to put that variable into. On Ubuntu that would for example be /etc/environment.

share|improve this answer
add comment

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.