Re: Global proxy autoconfig script?

From: Michael Pelletier <mikep@dont-contact.us>
Date: Wed, 10 Sep 1997 10:32:31 -0400 (EDT)

--MimeMultipartBoundary
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Wed, 10 Sep 1997, Oskar Pearson wrote:

> We were talking about a global web server that would run a script, and
> based on the IP address of the client machine, return a different
> java auto-config script.

Try using "myIpAddress()" in the script, such as:

----------
FindProxyForUrl() {

 if (isInNet(myIpAddress(), "198.95.27.0", "255.255.255.0") {
        return "PROXY net27-proxy.foo.com:3128; main-proxy.foo.com:3128";
 } else {
        return "PROXY main-proxy.foo.com:3128";
 }
----------

This will cause any user in the "198.95.27" network to use the Squid proxy
on net-27.foo.com, with a fallback to the main proxy server, and everyone
else will use the main proxy.

This is how I'm planning to implement multiple proxies here. Anyone
familiar enough with JavaScript who could suggest a way to munge the
network number into a proxy name to avoid a large sequence of if
statements, or know how to implement a "case" statement in JavaScript?

Of course, the cgi approach might be better, since the processing onus is
no longer on the client.

        -Mike Pelletier.

--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:43 MDT

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