土鳖了,今天才发现还有这个玩意儿:
http://en.wikipedia.org/wiki/Proxy_auto-config
这下方便多了,不用每次都往”No Proxy For”里添加条目了(-_-!)。。
我的PAC (Proxy_auto-config) 文件:
function isBlockedHost(host)
{
if (shExpMatch(host, “*google.*”) ||
shExpMatch(host, “*ggpht.*”) ||
shExpMatch(host, “*alexa.com*”) ||
shExpMatch(host, “*blogspot.com*”) ||
shExpMatch(host, “*facebook.com*”) ||
shExpMatch(host, “*twitter.com*”) ||
shExpMatch(host, “*youtube.com*”) ||
shExpMatch(host, “*appspot.com*”) ||
shExpMatch(host, “*fc2.com”) ) {
return true;
}
return false;
}// browser’s API
function FindProxyForURL(url, host)
{
var direct = “DIRECT”;
var socksProxy = “SOCKS5 127.0.0.1:9999”; // 注意这里需要指定为SOCKS5,才会进行remote dns resolveif (isBlockedHost(host))
{
return socksProxy;
}return direct;
}
参考文章:
http://blog.solrex.org/articles/remote-dns-lookup.html
http://fanqiangchinagfw.blogspot.com/2010/08/dnsfirefox-dns-resolving.html
发表回复