Re: [squid-users] proxy.pac

From: Larry J Eng <Larry_J_Eng@dont-contact.us>
Date: Tue, 16 Oct 2001 14:25:26 -0400

Jorge,
     Try this...
function FindProxyForURL(url, host)
    {
        if (isPlainHostName(host) ||
            dnsDomainIs(host, ".sat.gob.mx") ||
            dnsDomainIs(host, ".aduanas.gob.mx") ||
            dnsDomainIs(host, ".isosa.com.mx") ||
            isInNet (host, "99.0.0.0","255.0.0.0") ||
            isInNet (host, "101.0.0.0","255.0.0.0") ||
            isInNet (host, "223.53.0.0.0","255.0.0.0"))
            return "DIRECT";
       else if (isInNet(MyIPAddress, "223.53.0.0", "255.255.0.0"))
           return "PROXY proxy1:3128; PROXY proxy:3128";
        else
            return "PROXY proxy:3128; PROXY proxy1:3128";
    }

I believe host is really for the host of the URL (ie www.yahoo.com) and
MyIPAddress is the workstations IP. Also you might want to use
'shExpMatch(host, "site")' instead of dnsDomainIs, because I think I read that
dnsDomainIs has to do a DNS query each time.

Larry

Jorge Cuellar Martinez <jorge.cuellar@sat.gob.mx> on 10/16/2001 01:25:01 PM

To: squid-users@squid-cache.org
cc: (bcc: Larry J Eng/TheGuardian)

Subject: [squid-users] proxy.pac

And once again... a question of this file

i've read lots of documentation, but i cannot see a case using what i want
to use...

so here's my question

i want to use a proxy for certains subnets, so i'm trying to use
MyIPAddress() to compare it thru a list of subnets... but it's not working
or i'm not understanding exactly how it works...

here's my proxy.pac file..
(and i'm using it for IE5)

function FindProxyForURL(url, host)
    {
        if (isPlainHostName(host) ||
            dnsDomainIs(host, ".sat.gob.mx") ||
            dnsDomainIs(host, ".aduanas.gob.mx") ||
            dnsDomainIs(host, ".isosa.com.mx") ||
            isInNet (host, "99.0.0.0","255.0.0.0") ||
            isInNet (host, "101.0.0.0","255.0.0.0") ||
            isInNet (host, "223.53.0.0.0","255.0.0.0"))
            return "DIRECT";
       else if MyIPAddress() == (host, "223.53.0.0","255.255.0.0")
           return "PROXY proxy1:3128; PROXY proxy:3128";
        else
            return "PROXY proxy:3128; PROXY proxy1:3128";
    }

it only works fine if i took away the two lines of :
       else if MyIPAddress() == (host, "223.53.0.0","255.255.0.0")
           return "PROXY proxy1:3128; PROXY proxy:3128";

but then all goes thru the proxy and if it fails they will try the other,
but no one looks for proxy1 as it's first try

i hope somebody can help me... sorry about my ignorance about this pac file
configuration.. =/

 <mailto:jorge.cuellar@sat.gob.mx> Jorge Cu

éllar.
Servicio de <http://www.sat.gob.mx/> Administración Tributaria
 <http://intrasat/Dgti/Aco/default.htm> Seguridad Informática
Tel: 5483-1105 Extensión 7167
 <http://www.esmas.com/skytel/mensajes/> Skytel PIN:
<mailto:5583533@skytel.com.mx> 5583533
Received on Tue Oct 16 2001 - 12:25:52 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:02:46 MST