对于处在校园网,使用代理服务的朋友注意!

让IE只对指定的网站使用代理,可以使用系统自带的代理脚本功能,自动为我们设定的网站使用代理!

这个要使用代理自动配置脚本代码如下:


function FindProxyForURL(url,host)

  {

        if (host == "www.sciencedirect.com")

          return "PROXY 127.0.01:80";


        return "DIRECT";

      }

 

 

另一种脚本

 

function FindProxyForURL(url,host)

{

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:\下面