Skip to content

Commit

Permalink
Update BackendRelayHandler.java
Browse files Browse the repository at this point in the history
  • Loading branch information
youfanx committed Dec 9, 2024
1 parent ee55926 commit 9117f35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rxlib/src/main/java/org/rx/net/socks/BackendRelayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.netty.handler.proxy.ProxyConnectException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.rx.core.Strings;
import org.rx.net.Sockets;

@Slf4j
Expand Down Expand Up @@ -46,11 +47,11 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
Channel outbound = ctx.channel();
SocksContext sc = SocksContext.ctx(outbound);
// if (cause instanceof ProxyConnectException) {
// log.warn("RELAY {}[{}] => {} thrown\n{}", outbound.remoteAddress(), outbound.localAddress(), sc.inbound.remoteAddress(), cause.getMessage());
// } else {
if (cause instanceof ProxyConnectException && Strings.lastIndexOf(cause.getMessage(), "timeout") != -1) {
log.warn("RELAY {}[{}] => {} thrown\n{}", outbound.remoteAddress(), outbound.localAddress(), sc.inbound.remoteAddress(), cause.getMessage());
} else {
log.warn("RELAY {}[{}] => {} thrown", outbound.remoteAddress(), outbound.localAddress(), sc.inbound.remoteAddress(), cause);
// }
}
Sockets.closeOnFlushed(outbound);
}
}

0 comments on commit 9117f35

Please sign in to comment.