mirror of
https://github.com/iBug/pac.git
synced 2025-09-14 13:56:51 +08:00
commit
d564a01fdb
@ -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