From ee74de713ebf246e533ff81321686a1708240643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=84=9E?= Date: Mon, 9 Dec 2024 18:40:11 +0800 Subject: [PATCH] Update Socks5CommandRequestHandler.java --- .../java/org/rx/net/socks/Socks5CommandRequestHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rxlib/src/main/java/org/rx/net/socks/Socks5CommandRequestHandler.java b/rxlib/src/main/java/org/rx/net/socks/Socks5CommandRequestHandler.java index d65df57b..a830b7c2 100644 --- a/rxlib/src/main/java/org/rx/net/socks/Socks5CommandRequestHandler.java +++ b/rxlib/src/main/java/org/rx/net/socks/Socks5CommandRequestHandler.java @@ -90,7 +90,11 @@ private void connect(Channel inbound, Socks5AddressType dstAddrType, SocksContex return; } } - TraceHandler.INSTANCE.log("socks5[{}] connect {}[{}] fail", server.getConfig().getListenPort(), e.getUpstream().getDestination(), e.firstDestination, f.cause()); + if (f.cause() instanceof io.netty.channel.ConnectTimeoutException) { + log.warn("socks5[{}] connect {}[{}] fail\n{}", server.getConfig().getListenPort(), e.getUpstream().getDestination(), e.firstDestination, f.cause().getMessage()); + } else { + log.error("socks5[{}] connect {}[{}] fail", server.getConfig().getListenPort(), e.getUpstream().getDestination(), e.firstDestination, f.cause()); + } inbound.writeAndFlush(new DefaultSocks5CommandResponse(Socks5CommandStatus.FAILURE, dstAddrType)).addListener(ChannelFutureListener.CLOSE); return; }