mirror of
https://github.com/iBug/pac.git
synced 2025-07-14 05:12:17 +08:00
Handle IPv6 address
This commit is contained in:
parent
59ea42a877
commit
854289a674
5
code.js
5
code.js
@ -35,10 +35,11 @@ var proxy = "__PROXY__";
|
|||||||
var direct = "DIRECT";
|
var direct = "DIRECT";
|
||||||
|
|
||||||
function FindProxyForURL(url, host) {
|
function FindProxyForURL(url, host) {
|
||||||
if (!isResolvable(host)) {
|
var remote = dnsResolve(host);
|
||||||
|
if (!remote || remote.indexOf(":") !== -1) {
|
||||||
|
// resolution failed or is IPv6 addr
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
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