mirror of
https://github.com/iBug/pac.git
synced 2025-07-13 21:02:16 +08:00
fix code
Now checks if function "dnsResolveEx" exist.
This commit is contained in:
parent
713f5e397b
commit
b4672cad56
15
code.js
15
code.js
@ -184,15 +184,16 @@ function FindProxyForURL(url, host) {
|
||||
return proxy;
|
||||
}
|
||||
|
||||
// method for IPv6
|
||||
var remote = dnsResolveEx(host);
|
||||
if (!remote) {
|
||||
// fallback to legacy method
|
||||
var remote;
|
||||
if(typeof dnsResolveEx == 'function') {
|
||||
remote = dnsResolveEx(host);
|
||||
} else {
|
||||
remote = dnsResolve(host);
|
||||
if (!remote)
|
||||
return proxy;
|
||||
}
|
||||
else {
|
||||
|
||||
if (!remote) {
|
||||
return proxy;
|
||||
} else {
|
||||
remote = remote.split(";")[0];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user