Re: Autoproxy

From: Mark Visser <[email protected]>
Date: Mon, 2 Jun 1997 17:58:17 +0200 (MET DST)

On Tue, 3 Jun 1997, Peter Webb wrote:

> Hi
>
> Has anyone got a simple autoconfig script that works for both netscape 4.0
> and internet explorer 4.0?
>
> Thanks,
>
> Peter Webb
>
>
>

Try this:

file: proxy.pac:

// Automatic Proxy Configuration File
// Last update: 19970505
// Location: http://wwwserver/proxy.pac

function FindProxyForURL(url, host)
{
    if (isPlainHostName(host))
                return "DIRECT";
    else if (dnsDomainIs(host, "mydomain"))
                return "DIRECT";
    else if (dnsDomainIs(host, "localhost"))
                return "DIRECT";
    else if (dnsDomainIs(host, "mydomain") ||
             isInNet(host, "127.0.0.1", "255.255.0.0") ||
             isInNet(host, "myipdomain", "255.255.0.0"))
                return "DIRECT";
    else
        return "PROXY proxyserver:port";
}

For example:
mydomain = utwente.nl
myipdomain = 130.89.0.0
proxyserver = proxy.student.utwente.nl

This script defines that if the computer of which a page is requested is
in mydomain or myipdomain it will go direct to a WWW page (not use proxy)
and for every other page we will go through the proxy.

If proxy is unavailable go direct.

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

Mark

-------------------------------------------------------------------------
Mark Visser | Student Civiele Technologie & Management
Calslaan 26 - 31 | E-mail: mark@cal026031.student.utwente.nl
7522 MC Enschede | SNT-mail: mark@snt.student.utwente.nl
Telephone: 053-4895038 |
-------------------------------------------------------------------------
Warning: You can get rid of all the bugs by disabling them from the main menu.
Received on Mon Jun 02 1997 - 09:00:03 MDT

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