Our campus employs proxy server with authentication.
So, I have to apply 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.
3 Answers
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.
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.
1Yeah! There are many ways to do things. I made a tool to simplify the entire task, as I sometime had the same problem.This works on a Debian/Ubuntu system.
They are just shell scripts. You can download from here.