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 - 02:29:56 MDT
This archive was generated by hypermail pre-2.1.9 : Sun Jul 01 2007 - 12:00:04 MDT