[WEB4LIB] proxy.pac files
Josh Kuperman
josh at saratoga.lib.ny.us
Tue Jan 28 12:42:10 EST 2003
On Mon, Jan 27, 2003 at 10:35:44AM -0800, Josh Kuperman wrote:
[snip]
> They seem pretty good: I'm trying to write one that will switch from
> my old proxy to a new proxy, based on the ip address of the machines
> on my network. eg. if ip=192.168.1.45 use 192.168.1.2, if ip in range
> (192.168.1.92/27) use 192.168.1.1.
Figured I should be a little bit more specific. The only way I can
assign machines on my local network to a specific proxy is using the
myIpAddress function which tells me the address of the machines on my
network. Every other function for proxy access control files that I've
found so far checks the address of the requested website. If anyone
knows how to add or change the setup so I could get a myIpSubnet or
myIpRange fucntion let me know.
function FindProxyForURL(url, host)
{
if (myIpAddress() == "192.168.1.129")
return "PROXY 192.168.1.1:3128; DIRECT";
if (myIpAddress() == "192.168.1.130")
return "PROXY 192.168.1.1:3128; DIRECT";
// return "PROXY 192.168.1.75:3128; DIRECT";
return "DIRECT";
}
--
Josh Kuperman
josh at saratoga.lib.ny.us
More information about the Web4lib
mailing list