對於處在校園網,使用代理服務的朋友注意!服務器
讓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:\下面