需要上不同网站,经常要切换代理设置,不如写个脚本省事:
function FindProxyForURL(url, host)
{
if ( (url.substring(0, 4) != "http") || isPlainHostName(host) )
return "DIRECT";
else if(
//用ipv6 google 访问部分和谐网站
(shExpMatch(host, "*youtube.com")) ||
(shExpMatch(host, "*google.com")) ||
(shExpMatch(host, "*google.cn")) ||
(shExpMatch(host, "*blogger.com")) ||
(shExpMatch(host, "*appspot.com")) ||
(shExpMatch(host, "*ytimg.com")) ||
(shExpMatch(host, "*ggpht.com")) ||
(shExpMatch(host, "*blogspot.com")) )
{
if (url.substring(0, 5) != "https")
return "PROXY ipv6.google.com:80;";
}
else if(
//过滤教育网访问快的网站
(shExpMatch(host, "*219.*")) ||
(shExpMatch(host, "*202.*")) ||
(shExpMatch(host, "*.baidu.com")) ||
(shExpMatch(host, "*.sixxs.org")) ||
(shExpMatch(host, "*edu.cn")) ||
(shExpMatch(host, "*.youku.com")) ||
(shExpMatch(host, "*qq.com")) ||
(shExpMatch(host, "*.tudou.com")) )
return "DIRECT";
else
//使用高速教育网到网通及出国代理
return "PROXY 219.234.81.×××:80;";
}
这样只有少数情况需要将代理设置成直连就行了。
没有评论:
发表评论