Linux: how to set up proxy using pac script

seemuch picture seemuch · Aug 4, 2014 · Viewed 40.9k times · Source

I am using Red Hat Enterprise Linux Server release 6.2, and I have only terminal access (no GUI). My company has a proxy auto-config script (PAC), and that is the only way to get internet connection.

I had no problem with my windows machine, since it was easy to set it up in IE->Tools->Internet Options. But in Linux, especially without a GUI, there seems to be no way to use this PAC script (I have been Googling for a while). By the way, the script is over 400 lines of Javascript.

Anyone knows how to solve this problem?

Answer

Fabio A. Correa picture Fabio A. Correa · Oct 17, 2014

Proxy settings are implemented differently according to the software you use. On graphical desktop environments there are setup tools to configure a PAC; browsers like Chromium and Firefox detect the current desktop environment and import the proxy settings from there; Firefox also used to offer options for manual configuration of proxies and PAC URLs.

Integration of proxy options is not a priority for developers of text-only software packages. Each one of your tools will have to be manually configured to use a proxy. For example, APT must have a proxy configuration file at /etc/apt/apt.conf.d/.

Some packages may consult the environment variables http_proxy, https_proxy, et al, for proxy configuration.

You will need to read the documentation of the packages you will use in your GUI-less Linux to learn how to configure each of them to use the company's proxy. Some packages will use protocols and ports other than HTTP(S), FTP, GOPHER, which may be forbidden by the company's firewall.