Penguin

Differences between version 43 and predecessor to the previous major change of WPAD.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 43 Last edited on Tuesday, July 18, 2006 5:03:18 am by AristotlePagaltzis Revert
Older page: version 41 Last edited on Saturday, September 3, 2005 10:13:38 am by CraigBox Revert
@@ -1,103 +1,121 @@
 [Acronym] for __W__eb __P__roxy __A__uto__d__iscovery Protocol. 
  
 WPAD lets web browsers automatically find and use a WebProxy (see our ProxyServerNotes). A reasonable starting point for WPAD is here: http://www.squid-cache.org/Doc/FAQ/FAQ-5.html#ss5.10 
  
-WPAD lets you use many methods to automatically specify a proxy server configuration file on the network - [DHCP], [DNS], or manual specification. The file is a .PAC (Proxy Auto Configuration) file, which is defined in Netscape's [definition of PAC files|http://home.netscape.com/eng/mozilla/2./relnotes/demo/proxy-live.html]. 
+WPAD lets you use many methods to automatically specify a proxy server configuration file on the network - [DHCP], [DNS], or manual specification. The file is a .PAC (Proxy Auto Configuration) file, which is defined in Netscape's [definition of PAC files | http://home.netscape.com/eng/mozilla/2./relnotes/demo/proxy-live.html]. 
  
 ---- 
  
-!The Easy Method 
+!! ! The Easy Method 
  
-Step 1: if all your clients are something.yourdomain.tla (the connection suffix is assigned with DHCP - if you're unsure, and running Windows, run ' ipconfig' from a command prompt) 
+# If all your clients are <tt> something.yourdomain.tla</tt> (the connection suffix is assigned with [ DHCP] - if you're unsure, and running Windows, run <tt> ipconfig</tt> from a command prompt).  
  
-Step 2: set your gateway machine up so that it has a CNAME for wpad.yourdomain.tla pointing to server.yourdomain.tla 
+# Set your gateway machine up so that it has a CNAME for <tt> wpad.yourdomain.tla</tt> pointing to <tt> server.yourdomain.tla</tt>  
  
-Step 3: Copy something like this into your HTTP root as wpad.dat: 
+# Copy something like this into your document root as <tt> wpad.dat</tt>
  
-<verbatim>  
- function FindProxyForURL(url, host)  
- {  
- if(shExpMatch(url, "!https:*") || isPlainHostName(host) || \  
- dnsDomainIs(host, ".yourdomain.tla") || dnsDomainIs(host, ".youralias.tla"))  
-
+ <verbatim>  
+ function FindProxyForURL(url, host)  
+ {  
+ if( shExpMatch(url, "!https:*") || isPlainHostName(host) || \  
+ dnsDomainIs(host, ".yourdomain.tla") || dnsDomainIs(host, ".youralias.tla") )  
+
  return "DIRECT"; 
- } else { 
+ } else { 
  return "PROXY www-cache.yourdomain.tla:3128; DIRECT"; 
- }  
- }  
-</verbatim>  
-Step 4: Check you can access it by going ~http://wpad.yourdomain.tla/wpad.dat.  
+ }  
+ }  
+ </verbatim> 
  
-(Optional) Step 5: Make Apache serve it with the correct MIME type (x-ns-proxy-autoconfig) using a virtual host in your [Apache] configuration file ( /etc /apache /httpd .conf):  
+# Check you can access it by going <tt>~http: //wpad.yourdomain.tla /wpad.dat</tt>
  
-<verbatim >  
-<VirtualHost ip.ad.dr.es>  
- ServerName wpad.yourdomain.tla  
- ServerAlias ip.ad.dr.ess  
- AddType application/x-ns-proxy-autoconfig .dat  
- </VirtualHost >  
- </verbatim
+# Make Apache serve it with the correct [MIME] type ( <tt >application/x-ns-proxy-autoconfig</tt >) using a virtual host in your [Apache] configuration file (<tt>/etc/apache/httpd.conf </tt >):  
  
-(The alias is added because MSIE 6.00.2800.1106 on Win98SE does not look up the hostname.) 
+ <verbatim>  
+ <VirtualHost ip.ad.dr.es>  
+ ServerName wpad.yourdomain.tla  
+ ServerAlias ip.ad.dr.ess  
+ AddType application/x-ns-proxy-autoconfig .dat  
+ </VirtualHost>  
+ </verbatim>  
+  
+ (The alias is added because MSIE 6.00.2800.1106 on Win98SE does not look up the hostname.) 
  
 ---- 
  
 InternetExplorer has a "Automatically detect settings" check box. This will cause the browser to search for the configuration file. 
  
-If your DomainName is machine.something.meta.net.nz then InternetExplorer will request the following urls* until it finds a [WPAD] configuration file. 
+If your DomainName is machine.something.meta.net.nz then InternetExplorer will request the following [URL]s until it finds a [WPAD] configuration file.  
+  
+* <tt>~http://wpad.something.meta.net.nz/wpad.dat</tt>  
+* <tt>~http://wpad.meta.net.nz/wpad.dat</tt>  
+* <tt>~http://wpad.net.nz/wpad.dat</tt>  
+  
+(It’s only supposed to check to the second level, but according to the [Microsoft Security Bulletin MS99-054 | http://www.microsoft.com/technet/security/bulletin/ms99-054.mspx] the third level was special-cased in some unspecified ways. Presumably someone could register <tt>wpad.co.nz</tt> and be really nasty if they wanted.)  
  
-* ~ http://wpad .something .meta .net .nz /wpad .dat  
-* ~ http://wpad .meta .net.nz /wpad.dat  
-* ~http://wpad .net .nz/wpad.dat  
+ ''<tt>wpad.com</tt> does actually exist and is owned by Duane Wessles, the author of [Web Caching | http://www .oreilly .com/catalog/webcaching/] . There's no <tt>wpad .dat< /tt> there . I mailed him a while back asking about it, and he constantly gets between 10 and 40 hits per second depending on the time of day. The 404 logs for that site are at http://www .life-gone-hazy .com /~snmp/ http_status .cgi if you're interested .'' —zcat(1)  
  
 Note: you might need to take the tick out of the check box and put it back in order to make it go. 
  
-Warning: Beware that Internet Explorer 5.5+ may cache your wpad file and not recognize future changes you make to it -- this feature is referred to as Automatic Proxy Result Cache ([MS Knowledge Base 271361|KB :271361]). If you turn off "Automatically detect settings", save the change, restart IE, turn it back on, and restart IE again, then it will force a refresh of the wpad.dat file from your webserver (If you're lucky. It seems IE 6 refuses to flush even then) . Here is a [Google Groups' |http://groups.google.com/groups?q=squid+wpad.dat+doesn%27t+work&hl=en&lr=&ie=UTF-8&oe=UTF-8& selm=b6239t%24mif%241%40FreeBSD.csie.NCTU.edu.tw&rnum=3 ] discussion of the issue
+Warning: beware that Internet Explorer 5.5+ may cache your wpad file and not recognize future changes you make to it -- this feature is referred to as Automatic Proxy Result Cache ([MS KB 271361 | http ://support.microsoft.com/default.aspx?scid=kb;EN-US; 271361]). If you turn off "Automatically detect settings", save the change, restart IE, turn it back on, and restart IE again, then it will force a refresh of the <tt> wpad.dat</tt> file from your WebServer. (If you're lucky. It seems IE 6 refuses to flush even then.) Here is [a Google Groups discussion of the issue | http://groups.google.com/groups?selm=b6239t%24mif%241%40FreeBSD.csie.NCTU.edu.tw].  
+  
+Some versions of IE have a bug and request wpad.da instead of wpad.dat. Copying or linking wpad.dat to wpad.da should work around this. Don't forget to set the appropriate [MIME] type for this file as well
  
-Some versions of IE have a bug and request wpad.da instead of wpad.dat. Copying or linking wpad.dat to wpad.da should work around this. Don't forget to set the appropriate MIME type for this file as well.  
 ---- 
-Other alternatives include (subst. host.co.nz for your hostname):  
  
-The DHCP method (the MicrosoftCorporation "preferred option", which like most MSFT'isms, doesn't actually work) . Add the following to your /etc/dhcpd.conf 
+!!! Other alternatives  
+  
+(Substitute <tt>host.co.nz</tt> for your hostname in these examples.)  
+  
+  
+!! The DHCP method  
+  
+ MicrosoftCorporation's "preferred option", which like most MSFT'isms, doesn't actually work.  
+  
+ Add the following to your <tt> /etc/dhcpd.conf</tt>:  
  
 <verbatim> 
- option option-252 "http://wpad.host.co.nz/proxy.pac"; 
+option option-252 "http://wpad.host.co.nz/proxy.pac"; 
 </verbatim> 
  
-With ISC DHCP v3+, ' option-#' options don't work, You have to do this in the global section of your configuration: 
+With ISC DHCP v3+, <tt> option-#</tt> options don't work. You have to do this in the global section of your configuration:  
+  
 <verbatim> 
- option wpad-url code 252 = text; (define a new option) 
+option wpad-url code 252 = text; (define a new option) 
 </verbatim> 
  
 And add this in either the global or appropriate subnet section(s) of your configuration: 
+  
 <verbatim> 
- option wpad-url "http://wpad.my.domain.tld/proxy.pac\n"; (use new option) 
+option wpad-url "http://wpad.my.domain.tld/proxy.pac\n"; (use new option) 
 </verbatim> 
  
-You might like to try using an IP address there instead; there has been a report that a DNS domain doesn't work, but no indication on what version of dhcpd. 
+You might like to try using an [ IP] address there instead; there has been a report that a [ DNS] name doesn't work, but no indication on what version of dhcpd(8)
  
-__NOTE__ :  
-It seems tha IE eats the last character of the URL given in option 252. You have to append a space there (or any other character) to get it working: 
+__NOTE__:  
+It seems that IE eats the last character of the URL given in option 252. You have to append a space there (or any other character) to get it working: 
  
 <verbatim> 
- option wpad-url "http://wpad.my.domain.tld/proxy.pac "; 
+option wpad-url "http://wpad.my.domain.tld/proxy.pac "; 
 </verbatim> 
  
 (tested with ISC DHCPD server v3.0.1 and MS IE v6.0 SP2). 
  
-or if you're configuring a Windows DHCP server, right click on the server and click "Set predefined options" to add 252 as a String value (it's not in there by defult. See [here |http://support.microsoft.com/default.aspx?scid=kb;EN-US;252898] for more.) 
+or if you're configuring a Windows DHCP server, right click on the server and click "Set predefined options" to add 252 as a String value (it's not in there by defult. See [MS KB 252898 | http://support.microsoft.com/default.aspx?scid=kb;EN-US;252898] for more.) 
  
-The DNS method(s). Add all or some of the follwing entries to your DNS zone file. 
+!! The DNS method(s)  
+  
+ Add all or some of the follwing entries to your DNS zone file. 
  
 <verbatim> 
- $ORIGIN host.co.nz.  
- wpad IN A 192.168..254  
- IN TXT "service: wpad:!http://wpad.host.co.nz:80/proxy.pac"  
- wpad.tcp IN SRV 0 0 80 wpad.host.co.nz. 
+$ORIGIN host.co.nz.  
+wpad IN A 192.168..254  
+ IN TXT "service: wpad:!http://wpad.host.co.nz:80/proxy.pac"  
+wpad.tcp IN SRV 0 0 80 wpad.host.co.nz. 
 </verbatim> 
  
-See also:  
+!!! See also 
  
 * RFC:2052 
 * RFC:3040 
 * [Internet Draft on WPAD|http://www.web-cache.com/Writings/Internet-Drafts/draft-ietf-wrec-wpad-01.txt] 
@@ -116,43 +134,42 @@
  
 It seems Konqueror does not know the function "isInNet". Therefore, I changed the config slightly: 
  
 <verbatim> 
- var proxy_yes = "PROXY proxy.i.zmi.at:3128; DIRECT";  
- var proxy_no = "DIRECT"; 
+var proxy_yes = "PROXY proxy.i.zmi.at:3128; DIRECT";  
+var proxy_no = "DIRECT"; 
  
- // WARNING: The "dnsDomainIs" is a check of which DNS domain the _client_  
- // is inside. It's not a check for where the client wants to go!!!  
- // if (dnsDomainIs( host,"zmi.at") { return proxy_no; } 
+// WARNING: The "dnsDomainIs" is a check of which DNS domain the _client_  
+// is inside. It's not a check for where the client wants to go!!!  
+// if (dnsDomainIs( host,"zmi.at") { return proxy_no; }  
+// Proxy if PC is on local LAN - doesn't work with Konqueror!  
+// So this test is for Internet Explorer and compatible only  
+if (isInNet(myIpAddress(), "10...", "255...") || isInNet(myIpAddress(), "192.168..", "255.255..")) {  
+ if(  
+ url.substring(, 5) == "http:"  
+ || url.substring(, 4) == "ftp:"  
+ || url.substring(, 7) == "gopher:"  
+ )  
+ return proxy_yes;  
+ else  
+ return proxy_no;  
+
  
- // Proxy if PC is on local LAN - doesn't work with Konqueror!  
- // So this test is for Internet Explorer and compatible only  
- if (isInNet(myIpAddress(), "10...", "255...") || isInNet(myIpAddress(), "192.168..", "255.255..")) {  
- if (url.substring(, 5) == "http:" ||  
- url.substring(, 4) == "ftp:" ||  
- url.substring(, 7) == "gopher:")  
- return proxy_yes;  
- else  
- return proxy_no;  
- }  
- // Konqueror comes until here:  
- if (url.substring(, 5) == "http:" ||  
- url.substring(, 4) == "ftp:" ||  
- url.substring(, 7) == "gopher:")  
- return proxy_yes;  
- else  
- return proxy_no; 
+// Konqueror comes until here:  
+if(  
+ url.substring(, 5) == "http:"  
+ || url.substring(, 4) == "ftp:"  
+ || url.substring(, 7) == "gopher:"  
+ )  
+ return proxy_yes;  
+else  
+ return proxy_no; 
 </verbatim> 
  
-  
- Now you even can differentiate between Konqueror and Internet Explorer , and could give them different proxies. If you want to download the running config, visit ! http://zmi.at/wpad.dat 
+Now you even can differentiate between Konqueror and InternetExplorer , and could give them different proxies. If you want to download the running config, visit http://zmi.at/wpad.dat 
  
 ---- 
-!Footnotes  
-  
-* ~[*] Though it checks only to the second level, I would assume that someone could register wpad.co.nz and be really nasty if they wanted. According to the [Microsoft Security Bulletin MS99-054|http://www.microsoft.com/technet/security/bulletin/ms99-054.mspx] was the third level special-cased in some unspecified ways.  
  
-wpad.com does actually exist and is owned by Duane Wessles, the author of [Web Caching|http://www.oreilly.com/catalog/webcaching/]. There 's no wpad.dat there.  
-I mailed him a while back asking about it , and he constantly gets between 10 and 40 hits per second depending on the time of day . The 404 logs for that site are at http: //www .life-gone-hazy .com/~snmp/http_status .cgi if you 're interested.  
+''I do not know about using <tt> wpad.dat</tt> , but using <tt>proxy .pac< /tt> isInNet() works perfectly in konqueror, i have tested in 3 .5 .3 .'' --Kasper Sandberg  
  
 ---- 
 CategorySystemAdministration