Skip to content

Commit

Permalink
Merge branch 'master' into rxsocks
Browse files Browse the repository at this point in the history
  • Loading branch information
RockyLOMO committed Mar 4, 2025
2 parents bd69327 + 9b45b90 commit 81ba5c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 101 deletions.
1 change: 0 additions & 1 deletion rxlib/src/main/java/org/rx/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ public void addWhiteList(InetAddress endpoint) {
AuthenticEndpoint udp2rawSvrEp = AuthenticEndpoint.valueOf(conf.udp2rawEndpoint);
frontConf.getUdp2rawServers().add(udp2rawSvrEp.getEndpoint());
}
//Authenticator.dbAuth(shadowUsers.select(p -> p.right).toList(), port + 1)
SocksProxyServer frontSvr = new SocksProxyServer(frontConf, new DefaultSocksAuthenticator(shadowUsers.select(p -> p.right).toList()));
Upstream shadowDnsUpstream = new Upstream(new UnresolvedEndpoint(shadowDnsEp));
TripleAction<SocksProxyServer, SocksContext> firstRoute = (s, e) -> {
Expand Down
95 changes: 0 additions & 95 deletions rxlib/src/main/java/org/rx/net/socks/DbAuthenticator.java

This file was deleted.

18 changes: 14 additions & 4 deletions rxlib/src/main/java/org/rx/net/support/EndpointTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,38 @@
import lombok.extern.slf4j.Slf4j;
import org.rx.core.Cache;
import org.rx.core.cache.MemoryCache;
import org.rx.net.Sockets;

import java.net.InetSocketAddress;
import java.net.SocketAddress;

import static org.rx.core.Sys.fastCacheKey;

@Slf4j
public final class EndpointTracer {
static final InetSocketAddress unknownAddr = Sockets.newAnyEndpoint(0);
final Cache<String, SocketAddress> index = Cache.getInstance(MemoryCache.class);

String key(SocketAddress sa) {
return fastCacheKey("EpTrace", sa);
}

public void link(Channel inbound, Channel outbound) {
SocketAddress data = index.get(key(outbound.localAddress()), k -> inbound.remoteAddress());
SocketAddress addr = index.get(key(outbound.localAddress()), k -> inbound.remoteAddress());
// log.info("EpTracer link {} <- {} {}", data.head, inbound, outbound);
}

public SocketAddress head(Channel channel) {
SocketAddress data = index.get(key(channel.remoteAddress()));
SocketAddress head = data == null ? channel.remoteAddress() : data;
//inbound channel
SocketAddress addr = index.get(key(channel.remoteAddress()));
if (addr == null) {
//outbound channel
addr = index.get(key(channel.localAddress()));
}
if (addr == null) {
addr = unknownAddr;
}
// log.info("EpTracer head {} <- {}", head, channel);
return head;
return addr;
}
}
2 changes: 1 addition & 1 deletion rxlib/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<logger name="io.netty" level="INFO"/>
<logger name="org.apache.sshd" level="INFO"/>
<!-- <logger name="org.rx.core.ThreadPool" level="INFO"/>-->
<logger name="org.rx.core.ThreadPool" level="INFO"/>
<logger name="org.rx.core.CpuWatchman" level="INFO"/>
<logger name="org.rx.io.EntityDatabaseImpl" level="INFO"/>
<!-- <logger name="org.rx.net" level="DEBUG"/>-->
Expand Down

0 comments on commit 81ba5c4

Please sign in to comment.