mirror of
https://github.com/iBug/pac.git
synced 2025-07-13 21:02:16 +08:00
解决某些情况下 DNS 不能解析和兼容 ipv6 的问题
This commit is contained in:
parent
acb28972f1
commit
075b641eb7
@ -27,6 +27,9 @@ var proxy = "__PROXY__";
|
|||||||
var direct = "DIRECT";
|
var direct = "DIRECT";
|
||||||
|
|
||||||
function FindProxyForURL(url, host) {
|
function FindProxyForURL(url, host) {
|
||||||
|
if (!isResolvable(host)) {
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
var remote = dnsResolve(host);
|
var remote = dnsResolve(host);
|
||||||
if (belongsToSubnet(remote, WHITELIST)) {
|
if (belongsToSubnet(remote, WHITELIST)) {
|
||||||
return direct;
|
return direct;
|
||||||
|
3
code.js
3
code.js
@ -32,6 +32,9 @@ function isLan(host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function FindProxyForURL(url, host) {
|
function FindProxyForURL(url, host) {
|
||||||
|
if (!isResolvable(host)) {
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
var remote = dnsResolve(host);
|
var remote = dnsResolve(host);
|
||||||
if (isLan(remote) || isChina(remote)) {
|
if (isLan(remote) || isChina(remote)) {
|
||||||
return "DIRECT";
|
return "DIRECT";
|
||||||
|
Loading…
Reference in New Issue
Block a user