proxy代理   soft软件   IT 业界特快   norton 诺顿病毒库   代理列表   search FTP搜索   whois IP地理位置   blog 追求完美  
money理财   life生活   RSS聚合门户   firefox WEB浏览器   免费域名   typeset 假古文   AntiVirus 反病毒   ipcn 站点导航  

« ntpdate time synchronization & date usage | Main | SquidNT - Squid 2.5 for Windows NT 4.0/2000/XP/2003 »

April 28, 2004

squid ipcn.pac use URLHash2 of SPS(Super Proxy Script) - remove ipcnauth

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/04/28/000474.html

ipcn proxy 暂时去掉身份认证 并增加根据请求网址选择缓存
大家什么都不需改  设好自动配置脚本就行
先过节了

 http_access deny tolib
-http_access allow tothu fromthu ipcnauth
+http_access allow tothu fromthu
 http_access deny tothu
-http_access allow ipcnauth !porn
+http_access allow !porn
 http_access deny all
 

-if(isPlainHostName(host) || dnsDomainIs(host,".cn"))  return "DIRECT";
+//if(isPlainHostName(host) || dnsDomainIs(host,".cn"))  return "DIRECT";
+if(isPlainHostName(host))  return "DIRECT";

-else return "PROXY proxy2.ipcn.org:PORT";
+else {
+     var n = URLhash2(url) % 5;
+     if (n < 4) return "PROXY proxy2.ipcn.org:PORT; PROXY proxy.ipcn.org:PORT; DIRECT";
+     if (n < 5) return "PROXY proxy.ipcn.org:PORT; PROXY proxy2.ipcn.org:PORT; DIRECT";
+     }
+}
+


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=str.length - 1;i >=0 ; 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;
}
 

----->

squid-2.5.STABLE5 以及 IPCN 的一些调整

ipcn.pac

[IPCN] proxy.ipcn.org 使用设置调整公告

[IPCN] 俺家代理的一个人性化改动 +补充说明

 

本blog WWW

Posted by windtear at April 28, 2004 7:32 PM

本站使用中的任何问题,请与 windtear @ windtear.net 联系
Copyright© 1999-2024 Windtear. All rights reserved.