Merge pull request #5 from Zhwt/master

解决某些情况下 DNS 不能解析和兼容 ipv6 的问题
This commit is contained in:
iBug ♦ 2019-11-22 22:18:30 +08:00 committed by GitHub
commit d564a01fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,9 @@ var proxy = "__PROXY__";
var direct = "DIRECT";
function FindProxyForURL(url, host) {
if (!isResolvable(host)) {
return proxy;
}
var remote = dnsResolve(host);
if (belongsToSubnet(remote, WHITELIST)) {
return direct;

View File

@ -32,6 +32,9 @@ function isLan(host) {
}
function FindProxyForURL(url, host) {
if (!isResolvable(host)) {
return proxy;
}
var remote = dnsResolve(host);
if (isLan(remote) || isChina(remote)) {
return "DIRECT";