« 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
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
http://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] 俺家代理的一个人性化改动 +补充说明
|
|
Posted by windtear at April 28, 2004 7:32 PM
Trackback Pings
TrackBack URL for this entry:
http://cgi.windtear.net/cgi-bin/wt-tb.cgi/474
Listed below are links to weblogs that reference squid ipcn.pac use URLHash2 of SPS(Super Proxy Script) - remove ipcnauth:
» proxy鑴氭湰(super proxy script)鐨勭紪鍐 from JIEER鐨勫崥瀹㈣鍧
鏁翠釜鑴氭湰鏄敱FindProxyForURL(url,host)鏉ヤ綔涓哄叆鍙g殑锛岃繑鍥炵殑鏈夊嚑绉 1) DIRECT 2) PROXY 61.167.120.130:9000 3) SOCKS socks.domain.example:3128 鑴氭湰鍐呯殑鍑芥暟鏈 1) dnsDomainIs dnsDomainIs(host,".mydomain.example") 2) isInNet isInNet(h... [Read More]
Tracked on July 31, 2005 9:10 PM
» proxy鑴氭湰(super proxy script)鐨勭紪鍐 from JIEER鐨勫崥瀹㈣鍧
sps,proxy,proxy鑴氭湰,浠g悊鑴氭湰 [Read More]
Tracked on November 27, 2005 1:03 PM
Post a comment
【
我爱网络】
2007-12-31 23:51
2007年度 ipcn.org/ipchina.org 总结报告
2007-12-31 00:31
vmware gsx server service
2007-12-31 00:15
squid 对 404 302 缓存的相关问题
2007-12-30 14:24
升级到 MovableType 3.3x 并修改 entry_basename 兼容性
2007-12-30 13:52
[php] realip judge 前面补0的ip格式剔除
2007-12-14 16:34
rm -rf * 系统管理员要排查的定时炸弹
2007-12-13 19:03
山西的宽带运营商太过分了 私自窜改dns解析
2007-12-13 16:35
F5 MIB 再学习 唯一性标记用地址的小bug
2007-12-11 22:15
perl 用Spreadsheet::WriteExcel写了个处理/读写excel的小程序
2007-12-11 13:39
perl 变量转义的问题