// // This file has been automatically generated by Information Systems Department - Web Cache Software // Written by Anthony Taylor (Anthony.Taylor@umist.ac.uk), 2000. // Please refer any problems to me at the above email address. Thanks. // function FindProxyForURL(url, host) { var hash = 0; var secondary_hash = 0; if (isPlainHostName(host) || //dnsDomainIs(host,".umist.ac.uk") || dnsDomainIs(host,"metaservice.umist.ac.uk") || // Anthony Taylor (16/08/2001) //dnsDomainIs(host,"mulder.umist.ac.uk") || // Anthony Taylor () //dnsDomainIs(host,"www.umist.ac.uk") || // Anthony Taylor () //dnsDomainIs(host,".mcc.ac.uk") || //dnsDomainIs(host,".man.ac.uk") || // Anthony Taylor () dnsDomainIs(host,".mbs.ac.uk") || // Rachid Chalabi (25/04/02 ICA problems) dnsDomainIs(host,"info.eps.manchester.ac.uk") || url.substring(0, 5) == "wais:") { return "DIRECT"; } if (shExpMatch(host,"*.microsoft.com")) return "PROXY 130.88.96.65:3128"; if (url.substring(0, 5) == "http:") { ////if (isInNet(myIpAddress(), "130.88.96.0", "255.255.224.0") || ////isInNet(myIpAddress(), "130.88.128.0", "255.255.224.0") || ////isInNet(myIpAddress(), "130.88.160.0", "255.255.240.0")) { //hash = (host.length % 2); hash=URLhash(myIpAddress()); //if (hash == 0) if ( (hash % 2) == 0 ) return "" + "PROXY 130.88.96.65:3128; "+ "PROXY 130.88.96.66:3128; "+ //"PROXY 130.88.96.67:3128; "+ "DIRECT"; //if (hash == 1) if ( (hash % 2) == 1 ) return "" + "PROXY 130.88.96.66:3128; "+ //"PROXY 130.88.96.67:3128; "+ "PROXY 130.88.96.65:3128; "+ "DIRECT"; return "" + "PROXY 130.88.96.65:3128; "+ //"PROXY 130.88.96.67:3128; "+ "PROXY 130.88.96.66:3128; "+ "DIRECT"; } //else { //return ""+ //"PROXY 130.88.209.20:3128; "+ //"DIRECT"; //} }else { return "DIRECT"; } } function URLhash(name) { var cnt=0; var str=name.toLowerCase(name); if ( str.length ==0) { return cnt; } for(var i=0;i < str.length ; i++) { var ch= atoi(str.substring(i,i + 1)); cnt = cnt + ch; } return cnt ; } function atoi(charstring) { if ( charstring == "a" ) return 0x61; if ( charstring == "b" ) return 0x62; if ( charstring == "c" ) return 0x63; if ( charstring == "d" ) return 0x64; if ( charstring == "e" ) return 0x65; if ( charstring == "f" ) return 0x66; if ( charstring == "g" ) return 0x67; if ( charstring == "h" ) return 0x68; if ( charstring == "i" ) return 0x69; if ( charstring == "j" ) return 0x6a; if ( charstring == "k" ) return 0x6b; if ( charstring == "l" ) return 0x6c; if ( charstring == "m" ) return 0x6d; if ( charstring == "n" ) return 0x6e; if ( charstring == "o" ) return 0x6f; if ( charstring == "p" ) return 0x70; if ( charstring == "q" ) return 0x71; if ( charstring == "r" ) return 0x72; if ( charstring == "s" ) return 0x73; if ( charstring == "t" ) return 0x74; if ( charstring == "u" ) return 0x75; if ( charstring == "v" ) return 0x76; if ( charstring == "w" ) return 0x77; if ( charstring == "x" ) return 0x78; if ( charstring == "y" ) return 0x79; if ( charstring == "z" ) return 0x7a; if ( charstring == "0" ) return 0x30; if ( charstring == "1" ) return 0x31; if ( charstring == "2" ) return 0x32; if ( charstring == "3" ) return 0x33; if ( charstring == "4" ) return 0x34; if ( charstring == "5" ) return 0x35; if ( charstring == "6" ) return 0x36; if ( charstring == "7" ) return 0x37; if ( charstring == "8" ) return 0x38; if ( charstring == "9" ) return 0x39; if ( charstring == "." ) return 0x2e; return 0x20; }