FW: [WEB4LIB] Re: proxy.pac files

Cantona, Eric ECantona at plcmc.org
Wed Jan 29 11:06:03 EST 2003


if	(isInNet(myIpAddress(),"192.168.2.0","255.255.255.0"))
        return "PROXY myproxy1.mynet.net:3128";
else if	(isInNet(myIpAddress(),"192.168.1.0","255.255.255.128"))
        return "PROXY myproxy2.mynet.net:3128";
else if	(isInNet(myIpAddress(),"192.168.1.128","255.255.255.128"))
        return "PROXY myproxy3.mynet.net:3128";

---------------------------------------------------------------
Kevin Moderow      kmoderow at plcmc.org
Information Technology Manager
Public Library of Charlotte 
Mecklenburg County
ipac.plcmc.org
---------------------------------------------------------------


-----Original Message-----
From: Josh Kuperman [mailto:josh at saratoga.lib.ny.us]
Sent: Tuesday, January 28, 2003 12:46 PM
To: Multiple recipients of list
Subject: [WEB4LIB] Re: proxy.pac files


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