【fix】客户端渗透客户端编码

This commit is contained in:
wujiawei
2024-09-21 00:39:35 +08:00
parent 8f1f23eb2b
commit b4daa3ba70

View File

@ -54,9 +54,9 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
internalNetworkPermeateServerVisitor.setVisitorId(visitorId);
// 判断是否有可用的通道 如果没有创建新的通道
// Channel transferChannel = nettyChannelPool.availableChannel(visitorId);
// 创建访客连接服务端通道
// 创建访客连接客户端通道
NettyClientTransferClientSocket.buildTransferServer(internalNetworkPermeateServerVisitor);
log.info("客户端渗透服务端访客端口连接成功了");
log.info("客户端渗透客户端访客端口连接成功了");
super.channelActive(ctx);
}
@ -71,7 +71,7 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
byte[] bytes = new byte[buf.readableBytes()];
buf.readBytes(bytes);
// 获取客户端通道,而后进行数据下发
log.debug("【客户端渗透服务端】访客端口成功接收数据:{}", new String(bytes));
log.debug("【客户端渗透客户端】访客端口成功接收数据:{}", new String(bytes));
// 使用访客的通信通道
Integer visitorPort = internalNetworkPermeateServerVisitor.getVisitorPort();
@ -81,7 +81,7 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setData(bytes);
nextChannel.writeAndFlush(nettyProxyMsg);
log.debug("【客户端渗透服务端】访客端口成功发送数据了");
log.debug("【客户端渗透客户端】访客端口成功发送数据了");
}
@Override
@ -100,7 +100,7 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
nextChannel.config().setOption(ChannelOption.AUTO_READ, true);
// 通知服务端 关闭访问通道、真实通道
// 通知客户端 关闭访问通道、真实通道
NettyProxyMsg myMsg = new NettyProxyMsg();
myMsg.setType(MessageType.DISTRIBUTE_SINGLE_CLIENT_REAL_CLOSE_VISITOR);
myMsg.setVisitorId(visitorId);
@ -109,7 +109,7 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
// 关闭 访客通信通道、访客真实通道
NettyRealIdContext.clear(visitorId);
NettyCommunicationIdContext.clear(visitorId);
log.warn("【客户端渗透服务端】访客端口断开连接");
log.warn("【客户端渗透客户端】访客端口断开连接");
super.channelInactive(ctx);
}