Re: [squid-users] autoconfig pac file

From: Toto Carpaccio <shoktai@dont-contact.us>
Date: Thu, 24 Nov 2005 09:49:30 +0100

You rule Ben :)

2005/11/24, Ben Tanner <b.tanner@canterbury.ac.uk>:
> Hi there Toto,
>
> I think you want to do something like this:
>
> function FindProxyForURL(url, host)
> {
> if (isPlainHostName(host) ||
> isInNet(myIpAddress(), "10.2.0.0", "255.255.0.0"))
> return "PROXY 10.1.1.13:3128";
> else
> return "DIRECT";
> }
>
>
> Otherwise what you're doing is a DNS lookup against the host the client is attempting to fetch, and then checking to see if that destination is in the relevant subnet. This code will check that you're not attempting to access a local page (removes load off your proxy) and then check to see if the client IP is in the specified IP range.
>
> Hope that helps,
>
> Ben
> --
> Ben Tanner
> Senior Computing Officer
> Network Support Unit
> E-Mail: <b.tanner@canterbury.ac.uk>
> Phone: <2977>
>
>
Received on Thu Nov 24 2005 - 01:49:32 MST

This archive was generated by hypermail pre-2.1.9 : Thu Dec 01 2005 - 12:00:10 MST