Re: [squid-users] Proxy configuration scripts

From: Neil A. Hillard <hillardn@dont-contact.us>
Date: Thu, 24 Apr 2003 14:57:36 +0100 (BST)

Hi,

> Neil A. Hillard wrote:
>
> >Hi,
> >
> >>So far I have the following in a file called proxy.pac. It doesn't disable
> >>the cache for local browsing.
> >>
> >>function FindProxyForURL(url, host)
> >>{
> >>return "PROXY 192.168.2.33:3128; DIRECT";
> >>}
> >>
> >>I'd like to disable the cache for all hosts from 192.168.2.0 - 192.168.2.40.
> >>My squid server is on 192.168.2.33.
> >>
> >>
> >I suspect that the following will work for you (I'm guessing that you're
> >on a /24 network, if not, you'll have to adjust the netmask):
> >
> >function FindProxyForURL(url, host)
> >{
> > if (isInNet(host, "192.168.2.0", "255.255.255.0"))
> > {
> > return "DIRECT";
> > }
> > else
> > {
> > return "PROXY 192.168.2.33:3128";
> > }
> >}
> >
> >
> I also did this one @work, but the answer times to the request increase
> incedible. Most increase is noticable with Netscape 4.7 / Mozilla.
> Internet Explorer slows down, too. But not as hard as the Mozilla
> Familiy. I guess it has something to do with Resolving the name from the
> proxy-requests. The Cache @work only works as a child to a parent and
> has no possibility to connect directly to the internet or to to resolve
> hostnames outside the local net.
> Does someone have a solvation for this ?

When using the isInNet() function, anything passed that isn't an IP
address needs to be looked up in DNS to resolve it's IP address. If your
clients are not able to resolve external addresses from their configured
DNS servers then you will not be able to use this function (unless you
want to wait until things timeout) :-(

Regards,

                                Neil.

-- 
Neil Hillard                    hillardn@whl.co.uk
Westland Helicopters Ltd.       http://www.whl.co.uk/
Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.
Received on Thu Apr 24 2003 - 08:52:08 MDT

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