[squid-users] Proxy Autodetect scripts

From: <alaslavic@dont-contact.us>
Date: Tue, 7 Sep 2004 14:20:53 -0400

I'm having some issues with the black art of proxy autodetect scripts
(wpad.dat). I'm having a tough time getting it to work consistantly. I am
doing a phased roll-out of a squid proxy server, and want to the the
autodetect return "proxy:3128" for some ip addresses, and "DIRECT" for
others.

The script works for some hosts, but not for others. It works in the first
couple of class C subnets mentioned, but it breaks down where the specific
hosts are set to DIRECT (with the mask of 255.255.255.255), or anywhere
below that in the script such as where 10.7.0.0/255.255.254.0 is supposed
to be proxied.

Anyone have any suggesions?

code below:
################ wpad.dat ##############
     if (isInNet(myIpAddress(), "10.7.39.0", "255.255.255.0")) {
      return "PROXY proxy:3128";
        }
     else if (isInNet(myIpAddress(), "10.7.22.0", "255.255.255.0")) {
      return "PROXY proxy:3128";
        }
     else if (isInNet(myIpAddress(), "10.7.33.0", "255.255.255.0")) {
      return "PROXY proxy:3128";
        }
     else if (isInNet(myIpAddress(), "10.7.34.0", "255.255.255.0")) {
      return "PROXY proxy:3128";
        }
     else if (isInNet(myIpAddress(), "10.7.35.0", "255.255.255.0")) {
      return "PROXY proxy:3128";
        }
     else if (isInNet(myIpAddress(), "10.7.1.216", "255.255.255.255")) {
      return "DIRECT";
        }
     else if (isInNet(myIpAddress(), "10.7.1.217", "255.255.255.255")) {
      return "DIRECT";
        }
     else if (isInNet(myIpAddress(), "10.7.1.219", "255.255.255.255")) {
      return "DIRECT";
        }
    else if (isInNet(myIpAddress(), "10.7.0.0", "255.255.254.0")) {
      return "PROXY proxy:3128";
        }
     else {
      return "DIRECT";
    }
}
####### end wpad.dat ############

Alex Laslavic
Havertys Tech Services
Received on Tue Sep 07 2004 - 12:25:04 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Oct 01 2004 - 12:00:02 MDT