Re: [squid-users] Timeouts/browser hang with "autodetect proxy"

From: Adrian Chadd <adrian@dont-contact.us>
Date: Fri, 9 Mar 2007 10:16:21 +0800

On Fri, Mar 09, 2007, David Gameau wrote:

> >From my experience, each isInNet() statement produces a separate DNS
> lookup.
> What you want to do is use isResolvable(host) before hand to
> short-circuit
> those steps.
>
> For example (if you wanted unresolvable DNS lookups to be forwarded to
> the
> proxy, to generate a decent error page), you might use something like
> this...
>
> function FindProxyForURL(url, host)
> {
> if ((isPlainHostName(host) ||
> (dnsDomainIs(host, ".example.com"))
> return "DIRECT";
> if (!isResolvable(host))
> return "PROXY proxy.example.com:3128";
> if ((isInNet(host, "192.168.0.0", "255.255.0.0") ||
> (isInNet(host, "169.254.0.0", "255.255.0.0") ||
> (isInNet(host, "10.0.0.0", "255.0.0.0"))
> return "DIRECT";
>
> return "PROXY proxy.example.com:3128";
> }

Nice! Brian, let me know if this fixes your problem. I'll add it into the Wiki
if it does.

And thanks David, I'm sure you've just saved a lot of people a lot of time!

Adrian
Received on Thu Mar 08 2007 - 19:07:35 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 31 2007 - 13:00:01 MDT