proxy autoconfig

tony.chamberlain at lemko.com tony.chamberlain at lemko.com
Wed Sep 19 10:46:54 UTC 2007


My mistake was misunderstanding isInNet.
I thought it was isInNet( host, ipstart, ipend ) where your
ipstart <= host <= ipend, but it is really
 isInNet( host, IP, MASK ). They IP & MASK and see
whether your IP address matches that network.



------------------------------

Message: 14
Date: Wed, 19 Sep 2007 11:55:30 +0930
From: Tim <ignored_mailbox at yahoo.com.au>
Subject: Re: proxy autoconfig
To: For users of Fedora <fedora-list at redhat.com>
Message-ID: <1190168730.2697.6.camel at localhost.localdomain>
Content-Type: text/plain

tony.chamberlain at lemko.com:
> function FindProxyForURL(url, host) {
> 
> if (isInNet(host, "10.0.0.0", "10.255.255.255")) {
> return "PROXY 192.168.5.15:8001";
> }
> 
> // All other requests are direct
> return "DIRECT";
> }

I think you're missing an "else" in the line before "// All".

Mine's like the following, although I'm doing the opposite of you
(bypassing the proxy for local IP addresses, and using the proxy for
anything I've not specifically listed).

 --- begin below ---

function FindProxyForURL(url, host)
{
 if (isPlainHostName(host) ||
 dnsDomainIs(host, ".localdomain") || 
 dnsDomainIs(host, ".google.com.au") || 
 dnsDomainIs(host, ".hotmail.com") || 
 dnsDomainIs(host, ".passport.com") ||
 isInNet (host, "127.0.0.0", "255.255.255.0") ||
 isInNet (host, "192.168.0.0", "255.255.0.0"))
 return "DIRECT";
 else
 return "PROXY proxy.localdomain:3128; DIRECT";
}

 --- finished above ---

Just for clarity's sake: "localdomain" is a local domain on my DNS
server, it's not a keyword with a special meaning.

-- 
[tim at bigblack ~]$ uname -ipr
2.6.22.4-65.fc7 i686 i386

****************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20070919/6260803d/attachment-0001.html 


More information about the users mailing list