RE: [squid-users] Squid + WPAD issues

From: Terry Dobbs <tdobbs@dont-contact.us>
Date: Wed, 6 Jun 2007 09:13:13 -0400

Yes, your right. I need the myIpAddress(), however like you said it
doesn't always works as desired. I also read somewhere that not all
browsers support that particular function. Right now that's what im
using (in theory I really don't care what proxy they use as they can
authenticate to either, but it makes logical and geographical sense to
distinguish between the two), but your idea seems pretty cool.

What exactly do you do though? What kind of script do you point them to,
is it the .pac java script? (anyway we can see a sample?). Im assuming
you do it in the "Automatic Configuration Script" field in Internet
Explorer, or do you still use the WPAD.dat file?

Thanks for any input.

-----Original Message-----
From: K K [mailto:kkadow@gmail.com]
Sent: Wednesday, June 06, 2007 4:30 AM
To: Terry Dobbs
Cc: squid-users@squid-cache.org
Subject: Re: [squid-users] Squid + WPAD issues

On 6/5/07, Terry Dobbs <tdobbs@associatedbrands.com> wrote:
> We have been using a proxy server with a WPAD.dat file for a year or
> two. Now, we have setup another squid server in a remote site. I need
> to configure the WPAD.dat file in a way where if you are on subnet A
> use Proxy Server A and if you are on subnet B user proxy server B.

In my environment, I've solved this by having a single proxy script and
setting all browsers to use the same URL, but the server where the file
is hosted actually generates the contents on the fly.

This way the script can be customized by the server in ways not
supported in the client, including providing a different default proxy
server/port to different clients.

The other reason I do this is to eliminate 99.9% of the DNS lookups by
the client -- in theory, we could disable Internet resolution by
internal workstations (we've done this once or twice,mostly by
accident) and so long as the proxy server was able to resolve, browsers
would never notice.

> For the life of me, I cannot get this to work. For example, I am using

> what is seen below, and it seems the only line that works is the
"else"
> statement so everyone is using the same server....?

Where you say:
      if (isInNet(host,"192.168.0.0","255.255.0.0"))

I think you meant:
      if (isInNet(myIpAddress() ,"192.168.0.0","255.255.0.0"))

While myIpAddress() is documented in the original Netscape
specification, it doesn't have provisions for hosts with multiple
interfaces. In the past I've seen false negatives, where the above test
returns false when it really should have been true. That's one reason
we instead have the web server hosting the script look at REMOTE_ADDR
instead.

Kevin

--
http://wiki.squid-cache.org/Technology/WPAD
^Watch this space^
Received on Wed Jun 06 2007 - 07:13:39 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Jul 01 2007 - 12:00:04 MDT