Re: Denying to serve several URLs

From: Russell Street <r.street@dont-contact.us>
Date: Mon, 20 Jan 1997 09:13:23 +1300 (NZDT)

> Please do post ;-)

Here it is. To use this you need to tell your HTTP server that .pac
files have MIME type "application/x-ns-proxy-autoconfig". We use
Apache and so have this line in our srm.conf:

        AddType application/x-ns-proxy-autoconfig pac

Enjoy
Russell
============================================================

// =================================================================
// File: http://www.auckland.ac.nz/proxy.pac
//
// This (javascript) is used by Netscape's automatic proxy selection
//
// It implements this policy:
// * If the URL is 'local' (inside auckland.ac.nz/130.216.0.0) then
// go DIRECTly.
// * Otherwise use the PROXY server (www-proxy.auckland.ac.nz:8080)
//
// We are only interested in caching http, ftp and gopher requests.
// Anything else (news, https, et al) goes directly.
//
// By Russell Street <r.street@auckland.ac.nz>
// See also:
// http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
// =================================================================

function FindProxyForURL(url, host) {
  // Cases we are not interested in...
  if ((url.substring(0, 5) != "http:") &&
      (url.substring(0, 4) != "ftp:") &&
      (url.substring(0, 7) != "gopher:")) {
    return "DIRECT";
  }

  // Inside UA...
  if (shExpMatch(host, "130.216.*.*") ||
      shExpMatch(host, "*auckland.ac.nz")) {
    return "DIRECT";
  }

  // Outside UA...
  return "PROXY www-proxy.auckland.ac.nz:8080 ; PROXY net.auckland.ac.nz:8080 ; DIRECT";
}

// End of file: http://www.auckland.ac.nz/proxy.pac
// =================================================================
Received on Sun Jan 19 1997 - 12:38:21 MST

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