Bart's Weblog

Just a blog…

Create WPAD/PAC files the easy way…

Posted by bartvdw on 0303/0909/2011

A very basic but flexible WPAD/PAC file with which you can start:

function FindProxyForURL(url, host) {
    //check for local domains
    if (dnsDomainIs(host,"fqdnA.internal.domain"))   {return "DIRECT";}

    //check for local IP addresses
    if ((shExpMatch(host,"127.0.0.1"))
        || (shExpMatch(host,"10.*.*.*"))  // Enter you local IP subnets
        ) {return "DIRECT";}

    //check for short host names
    if (isPlainHostName(host)) {return "DIRECT";}
   
    //else return proxy
    return "PROXY proxyA.internal.domain:8080";
}

 

McAfee KnowledgeBase – Web Gateway: Using PAC files with Web Gateway

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: