Ramblings of a Deranged Mind
Proxy Servers
One of the downsides of proxy servers is that most corporate networks have them and most home users don't. Having to remember to switch the proxy servers on and off is difficult because the setting is usually buried several layers deep in the Preferences of the browser.Two options exist for Firefox/Mozilla/Seamonkey users. The first is to use PrefBar from http://prefbar.mozdev.org/ which puts a preferences bar on the toolbar that you can use to turn your proxy settings on and off with a single click.
After installing PrefBar and restarting your browser, click on Customise, then click on "Proxies" in the left-column and click "Add Item", then click "OK". You'll now have a check box on the PrefBar toolbar that you can use to turn your proxy setting on or off.
The second option and this probably works for IE as well but I haven't tested it, is to use a PAC file. A PAC file is nothing more than a simple JavaScript file with a single function called "FindProxyForURL" that returns a proxy server name for a given URL.
The PAC file that I use is given below, and basically it says if the host is resolvable, i.e. the browser can get an IP address for the host from the local DNS server, then connect directly without a proxy, otherwise use the specified proxy server.
There is a line commented out that checks if the domain of the host ends with ".sun.com" and if it does, go direct, but I found that this breaks sites outside SWAN like www.sun.com and sunsolve.sun.com so I took it out. You can certainly put it back in for specific domains that you know are reacheable directly.
To use this file, save the following lines in a file on your local drive, e.g. proxy.pac, then in your browser, under "Network Settings", in "Automatic proxy configuration URL", put in the path to your local proxy.pac file, e.g. file:///Users/samktan/Documents/proxy.pac or file:///c:/Documents and Settings/samktan/My Documents/proxy.pac. Yes, that is three (3) forward slashes after the file: protocol specifier.
function FindProxyForURL(url, host)
{
if (isPlainHostName(host) ||
// dnsDomainIs(host, ".sun.com") ||
isResolvable(host))
return "DIRECT";
else
return "PROXY webcache.sfbay.sun.com:8080; DIRECT";
}
Now no matter where I go, I don't have to worry about checking my proxy settings, everything just works, as it should be.
Powered by ScribeFire.
Posted at 10:22AM Apr 27, 2007 by samktan in IT | Comments[4]
Friday Apr 27, 2007
Posted by rahul on April 27, 2007 at 12:05 PM EST #
Posted by William Hathaway on April 27, 2007 at 01:04 PM EST #
I took a look at switchproxy but it's Windows-only so I use prefbar.mozdev.org.
Posted by samktan on May 02, 2007 at 08:30 PM EST #
Posted by Lewis on May 08, 2007 at 07:33 PM EST #