Re: .pac auto-config files

From: Brett Lymn <blymn@dont-contact.us>
Date: Fri, 17 Mar 2000 11:03:28 +1030 (CST)

According to Tilman Schmidt:
>
>I am doing something like that (or, if you want, the precise opposite)
>in my proxy.pac file:
>

Just to be picky, why don't you do this:

// If the client is not on one of the local networks (such as a roaming
// client), do not use the proxy server.
// local networks are mostly in 192.168.* but also some historical ones
var host_ip = myIpAddress();
if (!isInNet(host_ip, "192.168.0.0", "255.255.0.0") &&
     !isInNet(host_ip, "200.1.1.0", "255.255.255.0") &&
     !isInNet(host_ip, "200.1.2.0", "255.255.255.0") &&
     !isInNet(host_ip, "2.14.2.0", "255.255.255.0"))
         return "DIRECT";

Which cuts the calls to myIpAddress() to one. It is indeed a shame
that the 200.1.(1,2).0 networks are as they are otherwise you could
have killed another isInNet by changing the netmask. If 200.1.3.0 is
not in user you could replace the two isInNet's with:

isInNet(host_ip, "200.1.0.0", "255.255.252.0")

-- 
===============================================================================
Brett Lymn, Computer Systems Administrator, BAE SYSTEMS
===============================================================================
Received on Thu Mar 16 2000 - 17:38:25 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:52:16 MST