Re: JavaScript for Proxies

From: Doug Urner <dlu@dont-contact.us>
Date: Wed, 23 Oct 1996 13:19:51 -0700

>Hmm, has anyone written a JavaScript for automatic proxy detection?
>Netscape 3.0+ supports this feature and I would like to check it out,
>and possibly use it with our Squid proxy server.

Here is a very simple automatic configuration program that I'm using:

        function FindProxyForURL(url, host)
        {
          if ((isPlainHostName(host) ||
             dnsDomainIs(host, ".albatross.com")) &&
            !localHostOrDomainIs(host, "www.albatross.com"))

            return "DIRECT";
          else
            return "PROXY squid.albatross.com:3128; DIRECT";
        }

It is lifted pretty much verbatim from the Netscape Navigator release
note on the subject:

        http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html

Doug

--
Douglas L. Urner, dlu@bsdi.com, +1.503.231.4881
Received on Wed Oct 23 1996 - 13:20:18 MDT

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