Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

What does your wpad (Auto Proxy file) look like?


Recommended Posts

Posted

I've just re-set up my auto proxy file on a new server after I migrated from a win 2k server to win 2003. I noticed it was really slow when it was using the auto proxy file. I'm not sure if it was this slow before. This is my old wpad.dat and proxy.pac file:

function FindProxyForURL(url,host)
{ if(isPlainHostName(host)||
   isInNet(host,"10.39.0.0","255.255.254.0")) return "DIRECT";
 else return "PROXY 10.39.208.69:8080; DIRECT";
}

This should work out if the destination has a local IP address and, if not, send it to the proxy.

 

After some fiddling, I took out the bit that works out if it is local and now it runs fine:

function FindProxyForURL(url,host) { return "PROXY proxy:8080; DIRECT"; }

But now, of course, if I try to access a local resource it can't find it.

Is there a more efficient way of writing my original file?

(I need to use automatically detect settings, so other GP or reg based methods are no good).

Posted (edited)

Here's our proxy.pac. Probably not the most efficient but seems to work OK

 

function FindProxyForURL(url, host) {
   if (dnsDomainIs(host, "webmail.school.sch.uk") ||
isInNet(host, "10.15.228.0", "255.255.252.0"))
return "DIRECT";
   else
       return "PROXY 10.15.x.x:80; DIRECT";
}

 

This basically assumes anything 10.15.228.0 to 10.15.231.255 is local and everything else go via the proxy. I just want to pimp it a bit now so it uses a different proxy when connecting from certain IP's ;-)

Edited by TeddyKGB
Posted (edited)

Hmm... looks pretty similar to mine. Although, I've just noticed that my network address is wrong, so that won't help!

When I use the original script, it is noticeably slower - like it could take several seconds after clicking on the link to go to the page, and then, each graphic etc.. takes a few seconds longer. When the proxy is hard coded it is instant.

 

Really, I want it to say "If address is one word, like server, or suiteprinter then go direct, else go to proxy" - that should be less effort for it to work out?

 

In answer to your question, I think this function may help: myIpAddress()

- If you google it along with proxy auto config you get lots of threads of people struggling to get it to work! :)

Edited by eean

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...