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

« vmware-mount - 把 vmware vmdk 硬盘虚拟成本地硬盘的小工具 | Main | VisualRoute - 排查网络路由问题给出图形结果的小工具 »

March 7, 2006

代理服务器自动配置脚本(.PAC)的网络写法综述

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

代理服务器自动配置脚本(.PAC)的网络写法综述

今天水木新软俱乐部讨论起这个 这里就提一下自动配置脚本的配置写法
1. 网络写法 兼容性最好 如
http://proxy.ipcn.org/ipcn.pac

2. 本地文件写法 file://  IE两个/就行 firefox需要三个/
file:///c:/proxy/ipcn.pac
file://c:/proxy/ipcn.pac
如果遇到不行的情况 可以在自动配置脚本ipcn.pac里面加入 alert("test"); 便于测试

3. 网上邻居写法 这个是今天讨论时想要测试确认的
file://\\192.168.1.11\pub\proxy\ipcn.pac
file://\\ipcnserver2\pub\proxy\ipcn.pac
当时用ie测的 firefox 忘了测了

最后作为总结 考虑到不同操作系统不同浏览器的兼容性问题
第一种网络写法 http://proxy.ipcn.org/ipcn.pac 兼容性最好
基本支持自动配置脚本的都会支持这个 其他的如果遇到有细节上的不同 多试两把就行了

具体自动配置脚本(.PAC)的写法可以参考Netscape的官方文档 (就是一个特殊的javascript)
Navigator Proxy Auto-Config File Format
http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html


本blog曾写过的相关文章:  其中SPS(Super Proxy Script)比较好玩

[IPCN] proxy.ipcn.org 使用设置调整公告
http://windtear.net/archives/2004/02/16/000508.html

squid ipcn.pac use URLHash2 of SPS(Super Proxy Script) - remove ipcnauth
http://windtear.net/archives/2004/04/28/000474.html

IPCN简化设置Proxy
http://windtear.net/archives/2004/05/09/000471.html

花刺代理验证(ProxyThorn) v1.5.3 使用体验
http://windtear.net/archives/2004/12/20/000529.html

[IPCN] proxy.ipcn.org 允许使用访问更新
http://windtear.net/archives/2005/01/08/000549.html
本blog WWW

Posted by windtear at March 7, 2006 8:41 PM

Trackback Pings

TrackBack URL for this entry:
http://cgi.windtear.net/cgi-bin/wt-tb.cgi/932

Comments

请问 我编了一个 pac 文件.
我把它放到 服务器上去,但是在ie 那里写上
http://我的网址/proxy/proxy.pac
不起作用。该pac 文件放在本地机子上
file://d:\proxy.pac 是可以的。
pac文件是这样的:
function FindProxyForURL(url, host)
{
if (isPlainHostName(host)) return "DIRECT";
else if(dnsDomainIs(host, ".ip138.com"))
return "PROXY 24.6.**.***:808";
else
return "DIRECT";
}

Posted by: afei2003 at October 31, 2007 8:39 PM

先确认能访问
然后别让ie缓存 让每次都检查新页面
基本上就差不多了

Posted by: windtear at November 3, 2007 12:46 AM

Post a comment

Remember Me?



我爱网络
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 变量转义的问题

本站使用中的任何问题,请与 windtear SPAM windtear SPAM net 联系
Copyright© 1999-2008 Windtear. All rights reserved.
京ICP备05050670号