/*
* Super Proxy Script
*
* by Mr.ood
*
*
*
202.12.97.111 1
202.12.97.118 1
202.12.97.119 1
202.12.97.116 1
202.12.97.100 1
202.12.97.120 1
202.12.97.113 1
202.12.97.114 1
202.12.97.115 1
*/
function FindProxyForURL(url, host)
{
/* your original script here */
if( dnsDomainIs( host, "kano.moph.go.th" ) ||
dnsDomainIs( host, ".kku.net" ) ||
dnsDomainIs( host, "localhost" ) ||
isPlainHostName( host ) ||
isInNet( host, "127.0.0.1", "255.255.255.255" ) ||
isInNet( host, "202.12.97.0", "255.255.255.0" ) ||
isInNet( host, "202.28.92.0", "255.255.255.0" ) ||
isInNet( host, "202.28.93.0", "255.255.255.0" ) ||
isInNet( host, "202.28.94.0", "255.255.255.0" ) ||
isInNet( host, "202.28.95.0", "255.255.255.0" ) ||
isInNet( host, "202.28.116.0", "255.255.255.0" ) ||
isInNet( host, "202.28.117.0", "255.255.255.0" ) ||
isInNet( host, "202.28.118.0", "255.255.255.0" ) ||
isInNet( host, "202.28.119.0", "255.255.255.0" ) ||
isInNet( host, "10.0.0.0", "255.0.0.0" ) )
return "DIRECT";
else if (isPlainHostName(host) || dnsDomainIs(host, ".manager.co.th"))
return "PROXY 202.12.97.100:8088; PROXY 202.12.97.114:8088";
else
/* end of your original script */
var n = URLhash2(url) % 9;
if (n < 1)
return "PROXY 202.12.97.111:8088; PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
if (n < 2)
return "PROXY 202.12.97.119:8088; PROXY 202.12.97.118:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
if (n < 3)
return "PROXY 202.12.97.116:8088; PROXY 202.12.97.111:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
if (n < 4)
return "PROXY 202.12.97.118:8088; PROXY 202.12.97.116:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
if (n < 5)
return "PROXY 202.12.97.120:8088; PROXY 202.12.97.118:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;DIRECT";
if (n < 6)
return "PROXY 202.12.97.100:8088; PROXY 202.12.97.120:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.118:8088;PROXY 202.12.97.111:8088;DIRECT";
if (n < 7)
return "PROXY 202.12.97.113:8088; PROXY 202.12.97.120:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.118:8088;PROXY 202.12.97.111:8088;DIRECT";
if (n < 8)
return "PROXY 202.12.97.114:8088; PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
if (n < 9)
return "PROXY 202.12.97.115:8088; PROXY 202.12.97.111:8088;PROXY 202.12.97.119:8088;PROXY 202.12.97.100:8088;PROXY 202.12.97.120:8088;DIRECT";
}
/* make check sum of URL string */
/* v1.0 by SHARP Corp Copyright 1996-1997 */
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 ;
}
/*
URLhash2( ) for directory name hash computing version.
written by SHARP Corp in Feb 1997
Objects in the same directory will be accessed via the same proxy.
Use URLhash2( ) instead of URLhash( ) if you prefer to use persistent
connection in HTTP 1.1
http://www.sharp.co.jp/sample/test/img/mebius.gif
http://www.sharp.co.jp/sample/test/img/zaurus.gif
http://www.sharp.co.jp/sample/test/img/wiz.gif
<------------------------------------->
directory name hashing here
*/
function URLhash2(name)
{
var cnt=0;
var dirptr=0;
var str=name.toLowerCase(name);
if ( str.length ==0) {
return cnt;
}
/* skip filename in directory */
for(var i=9; i<str.length; i++) {
if ( str.substring(i,i +1) == '/' ) {
dirptr = i+1 ;
break;
}
}
for(var i=0;i < dirptr; 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;
}