Attachment 'sample1.pac.txt'

Download

   1 //We (www.is.co.za) run a central cache for our customers that they
   2 //access through a firewall - thus if they want to connect to their intranet
   3 //system (or anything in their domain at all) they have to connect
   4 //directly - hence all the "fiddling" to see if they are trying to connect
   5 //to their local domain.
   6 //
   7 //Replace each occurrence of company.com with your domain name
   8 //and if you have some kind of intranet system, make sure
   9 //that you put it's name in place of "internal" below.
  10 //
  11 //We also assume that your cache is called "cache.company.com", and
  12 //that it runs on port 8080. Change it down at the bottom.
  13 //
  14 //(C) Oskar Pearson and the Internet Solution (http://www.is.co.za)
  15 
  16 function FindProxyForURL(url, host)
  17 {
  18     //If they have only specified a hostname, go directly.
  19     if (isPlainHostName(host))
  20             return "DIRECT";
  21 
  22     //These connect directly if the machine they are trying to
  23     //connect to starts with "intranet" - ie http://intranet
  24     //Connect  directly if it is intranet.*
  25     //If you have another machine that you want them to
  26     //access directly, replace "internal*" with that
  27     //machine's name
  28     if (shExpMatch( host, "intranet*")||
  29                     shExpMatch(host, "internal*"))
  30         return "DIRECT";
  31 
  32     //Connect directly to our domains (NB for Important News)
  33     if (dnsDomainIs( host,"company.com")||
  34     //If you have another domain that you wish to connect to
  35     //directly, put it in here
  36                     dnsDomainIs(host,"sistercompany.com"))
  37         return "DIRECT";
  38 
  39     //So the error message "no such host" will appear through the
  40     //normal Netscape box - less support queries :)
  41     if (!isResolvable(host))
  42             return "DIRECT";
  43 
  44     //We only cache http, ftp and gopher
  45     if (url.substring(0, 5) == "http:" ||
  46                     url.substring(0, 4) == "ftp:"||
  47                     url.substring(0, 7) == "gopher:")
  48 
  49     //Change the ":8080" to the port that your cache
  50     //runs on, and "cache.company.com" to the machine that
  51     //you run the cache on
  52             return "PROXY cache.company.com:8080; DIRECT";
  53 
  54     //We don't cache WAIS
  55     if (url.substring(0, 5) == "wais:")
  56             return "DIRECT";
  57 
  58     else
  59             return "DIRECT";
  60 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-02-07 22:35:10, 2.2 KB) [[attachment:sample1.pac.txt]]
  • [get | view] (2006-02-07 22:35:27, 0.8 KB) [[attachment:sample2.pac.txt]]

You are not allowed to attach a file to this page.