【fix】修复服务端socks代理客户端时断时续问题

This commit is contained in:
wujiawei
2025-05-20 15:59:37 +08:00
parent 7f9cebec8a
commit c057d7b2d5
7 changed files with 16 additions and 12 deletions

View File

@ -50,6 +50,7 @@ public class NettySocksServerProxyClientRealHandler extends SimpleChannelInbound
// 客户端真实通信通道
Channel transferChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel());
if (transferChannel != null&&transferChannel.isActive()) {
log.debug("上报关闭这个客户端的访客通道");
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(ProxyMessageType.SOCKS_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_);

View File

@ -37,8 +37,11 @@ public class NettySocksServerProxyClientTransferHandler extends SimpleChannelInb
String visitorId = ChannelAttributeKeyUtils.getVisitorId(ctx.channel());
Channel realChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel());
log.warn("close server proxy client transfer real clientId:{} visitorId:{}", clientId, visitorId);
// 上报关闭当前通道
// 关闭真实通道
if (realChannel != null) {
log.debug("关闭真实通道");
realChannel.close();
}