Skip to content

Commit

Permalink
Merge branch 'master' into rxsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
youfanx committed Oct 28, 2024
2 parents 3f9f2a9 + 8644547 commit b0f431f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rxlib/src/main/java/org/rx/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static class RSSConf {
public int steeringTTL;
public List<String> gfwList;
public List<String> directList;
public boolean autoGfw;
public int waitIpInfoMillis = 1000;
public int ddnsSeconds;
public List<String> ddnsDomains;
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit b0f431f

Please sign in to comment.