Re: [squid-users] proxy.pac file

From: Kevin <kkadow@dont-contact.us>
Date: Tue, 29 Aug 2006 16:30:36 -0500

On 8/29/06, Raj <sunfire2005@gmail.com> wrote:
> I am running squid version 2.5.stable10. All the users use the
> following proxy.pac file

I do a lot with PAC, but never tried variables for return lines.
Rather, I've moved much of the intelligence into the server where the
PAC script is hosted.

> // VLAN's 112 --> 128
> if (isInNet(myIpAddress(), "172.26.112.0", "255.255.240.0")) return p43;

There are OS and browser idiosyncrasies with how PAC is processed,
for example, MSIE will sometimes return false positives from dnsDomainIs().

Another bug is that isInNet() will sometimes return false negatives.

Since we want to have different client subnets prefer different
gateways, what I've done is have the 'proxy.pac' URL actually be a CGI
script which does DNS lookups for the proxy addresses, and then
returns a slightly different PAC based on the source IP of the client,
phase of the moon, etc.

> All the users from 172.26.96.0 - 172.26.111.0 subnet goes to
> proxy03.domain.com first. If proxy03 is down the client should
> automatically try proxy04.domain.com. But that's not happening. If
> proxy03 is down, the clients are not failing over to proxy04. Is there
> any syntax error in p34.

I've tested this feature with a number of browsers, returning two
different proxy server IP addresses, and it does work reliably.

Many browsers do have a bug in failover, they will fail OVER to the
second proxy listed on the return line, but then when the first comes
back online, they never switch back; only way to switch back is to
exit the browser and restart.

On 8/29/06, Christoph Haas <email@christoph-haas.de> wrote:
> If you are looking for sophisticated load balancing and don't want to spend
> money on a hardware load-balancer there's also the "Super Proxy Script"
> (google for it) which uses a home-made hashing algorithm within the
> proxy.pac to distribute requests.

Good suggestion.
Received on Tue Aug 29 2006 - 15:30:43 MDT

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