please dont rip this site

WPAD (Web Proxy Auto Discovery)

WPAD.DAT is a Javascript program to automatically configure proxy servers on a per-URL basis.

Apparently uses the format of the Netscape PAC (Proxy Auto Config) file. The proxy autoconfig file is written in JavaScript. The file must define the function:

        function FindProxyForURL(url, host)

which will be called by the Navigator in the following way for every URL that is retrieved by it:

        ret = FindProxyForURL(url, host);


the full URL being accessed.
the hostname extracted from the URL. This is only for convenience, it is the exact same string as between :// and the first : or / after that. The port number is not included in this parameter. It can be extracted from the URL when necessary.
(the return value) a string describing the configuration. The format of this string is as follows:
If the string is null, no proxies should be used.
Connections should be made directly, without any proxies.
PROXY host:port
The specified proxy should be used.
SOCKS host:port
The specified SOCKS server should be used.

If there are multiple semicolon-separated settings, the left-most setting will be used, until the browser fails to establish the connection to the proxy. In that case the next value will be used, etc.

In the definition of the function, some predefined functions can be called:

Here is an example that hopes to show why this can be useful. In a large organizatoin running proxy servers for all web access, this script distributes load between 4 proxy servers. One for all .com request, one for .edu requests, another for all other requests and a fourth which is used if any of the first 3 fail to respond.

    function FindProxyForURL(url, host)
        if (isPlainHostName(host) || dnsDomainIs(host, ""))
            return "DIRECT";
        else if (shExpMatch(host, "*.com"))
            return "PROXY; " +
        else if (shExpMatch(host, "*.edu"))
            return "PROXY; " +
            return "PROXY; " +

See also:

file: /Techref/app/inet/wpad_dat.htm, 5KB, , updated: 2005/12/21 13:11, local time: 2024/7/18 04:17,

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> WPAD (Web Proxy Auto Discovery)</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?


Welcome to!

Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.

Welcome to!