Automatic Proxy Config scripts

From: Penisoara Adrian <>
Date: Tue, 6 May 1997 22:27:49 +0300 (EEST)

  Thank you all (Oskar, Mark, Ed, Richard) for helping me out.
  I believe I managed to make a pretty usable script, any more
suggestions ?

// Automatic Proxy Configuration File
// Last update: 19970506
// Location:

function FindProxyForURL(url,host)
 // Proxy server status (e.g. working[0] / down[1])

 // Is the proxy server down ?
  return "DIRECT";

 // Is it one of the supported protocols ?
 if( (url.substring(0,5)!="http:") &&
     (url.substring(0,4)!="ftp:") &&
     (url.substring(0,7)!="gopher:") )
  return "DIRECT";

 // Is it a plain hostname ?
  return "DIRECT";

 // Is it the 'localhost' alias ?
 if( shExpMatch(host,"localhost.*") ||
     shExpMatch(host,"") )
  return "DIRECT";

 // Is it in our domain ?
 if( shExpMatch(host,"*") ||
     shExpMatch(host,"193.226.124.*") )
  return "DIRECT";

 // We passed all exception rules, so...
 return "PROXY ; DIRECT";

 Yes, Richard, it's a stupid thing that NNavigator must do an DNS lookup
for an isInNet() call, maybe they shoul optimize it one day...
 Nice workaround for this with the shExpMatch(), Ed! But there are still
some problems, like nonstandard subnet IPs (like us, we have an netmask
 Unfortunately I couldn't acces, was it down for
some time ? Is the info in the FAQ a must-read anyway ?
 BTW, does anyone know what dnsDomainIs("","") will
return ? Practical should be a true value.

 Ady (
Received on Tue May 06 1997 - 14:25:39 MDT

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