对于处在校园网,使用代理服务的朋友注意!服务器
让IE只对指定的网站使用代理,能够使用系统自带的代理脚本功能,自动为咱们设定的网站使用代理!
这个要使用代理自动配置脚本代码以下:
function FindProxyForURL(url,host)ide
{wordpress
if (host == "www.sciencedirect.com")网站
return "PROXY 127.0.01:80";google
return "DIRECT";url
}.net
另外一种脚本代理
function FindProxyForURL(url,host)code
{blog
if (dnsDomainIs(host, “.blogspot.com”) ||
dnsDomainIs(host, “wordpress.com”) ||
dnsDomainIs(host, “wordpress.org”) ||
dnsDomainIs(host, “photomatt.net”) ||
dnsDomainIs(host, “.wikipedia.org”) ||
dnsDomainIs(host, “technorati.com”) ||
dnsDomainIs(host, “sourceforge.net”) ||
dnsDomainIs(host, “free-codecs.com”) ||
dnsDomainIs(host, “.opera.com”) ||
dnsDomainIs(host, “news.google.com”) ||
dnsDomainIs(host, “p_w_picpaths.google.com”) ||
dnsDomainIs(host, “.chinesenewsnet.com”) ||
dnsDomainIs(host, “rottentomatoes.com”) ||
dnsDomainIs(host, “flickr.com”) ||
shExpMatch(url, “http://*/search?q=cache*”))
return “PROXY 127.0.0.1:808″;
else
return “DIRECT”;
}
说明:以上脚本能够实现只对“host ”变量设定的网站使用代理,代理服务器IP和端口由“PROXY”进行设定。对其它非“host” 指定的网站,则进行直接链接,即便用“DIRECT”命令。
使用方法:
请先修改你须要使用代理访问的网站地址,替换上面的www.sciencedirect.com,以及你要使用的代理,替换上面的127.0.0.1:80,而后把以上命令输入一个文本文件,文件名改成proxy.pac ,也就是后缀必须是.pac。 而后在IE的“局域网设置”,代理相关选项中,使用这个文件作为自动配置的脚本文件,在“地址:”一栏输入这个文件在本机的位置,好比 file://c:/proxy.pac 表示你的proxy.pac文件在你的C:\下面