Fix incorrect mapper usage

This commit is contained in:
世界 2021-04-11 01:26:48 +08:00
parent 579e722873
commit 1ecfe3a9b0
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
2 changed files with 3 additions and 7 deletions

View File

@ -123,8 +123,8 @@ public class ProxyHandler implements Runnable {
}
Integer target = mapper.get(server);
if (target == null) {
target = mapper.get(StrUtil.subBefore(server, ".", true) + ".");
for (int i = 1; target == null && i < 4; i++) {
target = mapper.get(server.substring(0, server.length() - i));
}
if (target == null) {
FileLog.e("No route for ip " + server);

View File

@ -23,10 +23,7 @@ public class Tcp2wsServer extends Thread {
public static final HashMap<String, Integer> mapper = new HashMap<>();
static {
mapper.put("149.154.175.50", 1);
mapper.put("149.154.175.53", 1);
mapper.put("149.154.175.55", 1);
mapper.put("149.154.167.51", 2);
mapper.put("149.154.175.5", 1);
mapper.put("95.161.76.100", 2);
mapper.put("149.154.175.100", 3);
mapper.put("149.154.167.91", 4);
@ -37,7 +34,6 @@ public class Tcp2wsServer extends Thread {
mapper.put("2001:b28:f23d:f003:0000:0000:0000:000a", 3);
mapper.put("2001:67c:4e8:f004:0000:0000:0000:000a", 4);
mapper.put("2001:b28:f23f:f005:0000:0000:0000:000a", 5);
mapper.put("149.154.175.5", 1);
mapper.put("149.154.161.144", 2);
mapper.put("149.154.167.", 2);
mapper.put("149.154.175.1", 3);