Skip to content

Commit

Permalink
Update Socks5CommandRequestHandler.java
Browse files Browse the repository at this point in the history
  • Loading branch information
RockyLOMO committed Dec 9, 2024
1 parent 9117f35 commit ee74de7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ee74de7

Please sign in to comment.