From 075b641eb7d2adbea6a796adfe49e42c5b048885 Mon Sep 17 00:00:00 2001 From: Zhwt Date: Fri, 22 Nov 2019 21:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=20DNS=20=E4=B8=8D=E8=83=BD=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=92=8C=E5=85=BC=E5=AE=B9=20ipv6=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bypass-lan-and-china.pac | 3 +++ code.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bypass-lan-and-china.pac b/bypass-lan-and-china.pac index e137f42..e8e88af 100644 --- a/bypass-lan-and-china.pac +++ b/bypass-lan-and-china.pac @@ -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; diff --git a/code.js b/code.js index 01db4b1..f6b037e 100644 --- a/code.js +++ b/code.js @@ -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";