From 864454707636b181298abe739ffd78cf2f5b4c56 Mon Sep 17 00:00:00 2001 From: wxm <115806199+youfanx@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:16:04 +0800 Subject: [PATCH] Update Main.java --- rxlib/src/main/java/org/rx/Main.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rxlib/src/main/java/org/rx/Main.java b/rxlib/src/main/java/org/rx/Main.java index b54cdb03..3ad6340b 100644 --- a/rxlib/src/main/java/org/rx/Main.java +++ b/rxlib/src/main/java/org/rx/Main.java @@ -76,6 +76,7 @@ public static class RSSConf { public int steeringTTL; public List gfwList; public List directList; + public boolean autoGfw; public int waitIpInfoMillis = 1000; public int ddnsSeconds; public List ddnsDomains; @@ -283,9 +284,11 @@ public void addWhiteList(InetAddress endpoint) { gfw = true; } else if (Sockets.isBypass(conf.directList, host)) { gfw = false; - } else { + } else if (conf.autoGfw) { IPAddress ipAddress = awaitQuietly(() -> IPSearcher.DEFAULT.search(host, true), conf.waitIpInfoMillis); gfw = ipAddress == null || !ipAddress.isChina(); + } else { + gfw = true; } if (!gfw) { e.setUpstream(new Upstream(e.getFirstDestination()));