Log In | Users | Register
Welcome to Foswiki... Users, Groups
Go
Edit | Attach | New | Raw | Delete | History | Print | Tools
You are here:  Main » CensorNet » KnowledgeBase » Example WPAD.dat file
Synopsis: Example WPAD.dat file for use with CensorNet

The following example is a text file that should reside in /var/www/wpad.dat on the CensorNet server. The wpad.dat file should be used with DHCP. Please see the WPAD Configuration Guide for more information.

function FindProxyForURL(url, host)
{

        // Add hostname exceptions for sites you do not want to 
        // proxy e.g. internal servers

        if(shExpMatch(url,"*.bypassthis.com/*")) { return "DIRECT"; }
        if(shExpMatch(url,"*.bypassthis.com:*/*")) { return "DIRECT"; }

        // End hostname exceptions


        // If you want to allow a specific IP range to go direct, use the line 
        // below or remove it

        if(isInNet(host, "10.0.0.0", "255.255.255.0")) { return "DIRECT"; }

        // End network exceptions

        // Always bypass for localhost - make sure these 3 lines remain
        if (shExpMatch(host, "localhost*") || shExpMatch(host, "127.0.0.1*")) {
                return "DIRECT";
        }

        // The browser is on a specific network, so send it a specific proxy to use
        // This is useful for multi-subnet networks with multiple CensorNet servers
        // Remove if you do not need this

        if (isInNet(host, "10.0.41.0", "255.255.255.0")) {
                return "PROXY 10.0.41.15:8080";
        }

        // Finally, if it isn't to be bypassed and is not localhost, return 
        // the proxy IP and port to use

        return "PROXY 10.0.41.15:8080";
}

Notes:

To force Internet Explorer to reload the WPAD file you must first untick "Automatically Detect Settings", save the options and then restart the browser. Then tick "Automatically Detect Settings", save the options, and then restart the browser. This will force Internet Explorer to request a new copy of the WPAD file. If you do not do this it is likely Internet Explorer will use a cached copy of the file.

-- TimLloyd - 03 Feb 2010

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Syndicate this site RSSATOM