|More Configuration Details||_||_||_|
|INDEX BACK NEXT||_||_||_|
|Advanced client configuration|
This section covers what is known as Auto-Configuration of the client. This function of some browsers is very useful in certain cases. With it you can do things like:
The client machines download the script when they startup from a web server. This web server has to serve the file as a different mime-type. The Auto-Config script is normally a .pac file, so if you aren't already using this for something else you should put the mime type in your mime config file for your web server.
In apache (for example) put the following in your mime.types file
Two clients currently allow Auto-Configuration,
Netscape and Internet Explorer 3.02.
Bear in mind that this java script is run for
each URL that the browser connects to (The client has to decide if it should
connect to any given URL directly or via the cache - so if you connect to
your intranet it does a different thing to if you connect to a site
on the outside This can slow down the browser if you do things
like DNS lookups, which can take a while and thus add a delay
to each URL the person goes to.
Bear in mind that only the later versions of Internet Explorer support this function. You may have to upgrade to get the followin menus.
//We (www.is.co.za) run a central cache for our customers that they
//access through a firewall - thus if they want to connect to their intranet
//system (or anything in their domain at all) they have to connect
//directly - hence all the "fiddling" to see if they are trying to connect
//to their local domain.
//Replace each occurrence of company.com with your domain name
//and if you have some kind of intranet system, make sure
//that you put it's name in place of "internal" below.
//We also assume that your cache is called "cache.company.com", and
//that it runs on port 8080. Change it down at the bottom.
function FindProxyForURL(url, host)
//If they have only specified a hostname, go directly.
//These connect directly if the machine they are trying to
//connect to starts with "intranet" - ie http://intranet
//Connect directly if it is intranet.*
//If you have another machine that you want them to
//access directly, replace "internal*" with that
if (shExpMatch( host, "intranet*")||
//Connect directly to our domains (NB for Important News)
if (dnsDomainIs( host,"company.com")||
//If you have another domain that you wish to connect to
//directly, put it in here
//So the error message "no such host" will appear through the
//normal Netscape box - less support queries :)
//We only cache http, ftp and gopher
if (url.substring(0, 5) == "http:" ||
url.substring(0, 4) == "ftp:"||
url.substring(0, 7) == "gopher:")
//Change the ":8080" to the port that your cache
//runs on, and "cache.company.com" to the machine that
//you run the cache on
return "PROXY cache.company.com:8080; DIRECT";
//We don't cache WAIS
if (url.substring(0, 5) == "wais:")
You should copy the above script to a directory on a web server in a place that is easy to remember, http://www.mycompany.com/cache.pac might be a good place.
The Squid Users guide is copyright Oskar Pearson email@example.com
If you like the layout (I do), I can only thank William Mee and hope he forgives me for stealing it