Tuesday, February 09, 2010

How to automatically change proxy setting in Firefox ?

Proxy setting for office LAN / WLAN and home LAN / WLAN are often different. Firefox provides an easy method of changing proxies without having to do anything. The file proxy.pac provides an easy method of automatically changing proxy setting in Firefox from one network to another. There are elaborate methods of changing proxy settings given here. However the easiest method is described below.

Step 1: Edit the file proxy.pac (preferably save it at a convenient location) and add the following line.

function FindProxyForURL(url, host)  
{ 
   return "PROXY proxy.example.com:8080; DIRECT";  
}
Where proxy.example.com  is simply the address of proxy and could be replaced by the IP Address of the proxy server. 8080 is the port address for http in most networks but could be different in some networks.

Step 2: Go to Firefox Menu--> Tools --> Options --> Network Tab --> Click Setting Button --> Check the automatic proxy configuration url and enter "file:///your_path_goes_here/proxy.pac" in it.
Please ensure to replace the your_path_goes_here with the path where the file proxy.pac is saved. For example in my case it was file:///home/zahid/proxy.pac

Now the Firefox  will first check the proxy and if it is not responding then connect directly to the internet.

This removes the head ache of changing proxy settings on an almost daily basis. Peace at last !!

For those still using Internet Explorer :::  Please keep changing your proxy at regular intervals :)

No comments: