Re: Proxy Autoconfigfile

From: Jens Elkner <elkner@dont-contact.us>
Date: Fri, 18 Jul 1997 06:02:07 +0200 (MET DST)

'Gereon Ruetten wrote:'
> I have a problem with the autoconfig file.
>
> But this scriptfile doesn´t work. he allways want to connect the
> cache.rwth-aachen.de even if the machine is member of 137.226.73.*
> What is wrong ?

Use "host" instead of "myhost" and
url.indexOf("\?") > -1 instead of url.indexOf("?") >= 0
  
> function FindProxyForURL(url,host)
> {
> if (url.length > 4000) {
> return "DIRECT";
> }
> myhost=myIpAddress();
> // Baerenstrasse soll immer ueber den eigenen Cache gehen!
> if (isInNet(myhost,"137.226.73.0","255.255.255.0"))
              ^^^^^^
> return "PROXY cache.baer.rwth-aachen.de:8080;" +
> "PROXY cache.rwth-aachen.de:8080;" +
> "PROXY www-cache.informatik.uni-bonn.de:3128;" +
> "DIRECT";
> if (isPlainHostName(host) ||
> dnsDomainIs(host,".rwth-aachen.de") ||
> isInNet(host,"137.226.0.0","255.255.0.0") ||
> isInNet(host,"134.130.0.0","255.255.0.0") ||
> isInNet(host,"127.0.0.1","255.255.255.255") || // ... Hacker?
> (host == "localhost") || // localhost
^^^ you might consider deleting this line^^^

http://www.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html states:
isInNet(host, pattern, mask)
host ... a DNS hostname, or IP address. If a hostname is passed, it will be
         resolved into an IP address by this function.

and localhost should always be "127.0.0.1"

> (url.indexOf("?") >= 0) || // Form o.ae.
> shExpMatch(url, "http:*/cgi-bin/*") ||
> shExpMatch(url, "http:*.cgi") || // meist POSTs
> shExpMatch(url, "http:*/htbin/*") || // alte CERNs
> shExpMatch(url, "ftp:*:*@*") // ftp m. Passwort
> )
> return "DIRECT";
> if (shExpMatch(url,"wais:*"))
> return "DIRECT";
> return "PROXY cache.rwth-aachen.de:8080;" +
> "PROXY www-cache.informatik.uni-bonn.de:3128;" +
> "DIRECT";
> }

If you want, you can take a look at our current PAC:
http://irb.cs.uni-magdeburg.de/uni-md.pac.shtml

Have fun,
Jens.

-- 
+---[ Jens Elkner ]------[ IRB, Otto-von-Guericke-Universitaet Magdeburg ]-+
| Am Uniplatz 5                                                            |
| WH 4   PF 310                       elkner@irb.cs.uni-magdeburg.de       |
| 39106 Magdeburg   GERMANY       http://irb.cs.uni-magdeburg.de/~elkner   |
+--------------------------------------------------------------------------+
Received on Thu Jul 17 1997 - 21:07:00 MDT

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