mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-16 10:25:07 +08:00
【fix】修复服务端socks代理客户端时断时续问题
This commit is contained in:
@ -26,7 +26,7 @@ public class NettyProxy2RealInboundHandler extends ChannelInboundHandlerAdapter
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
log.info("本地转发客户端的请求到代理服务器");
|
||||
log.debug("本地转发客户端的请求到代理服务器");
|
||||
if (dstChannelFuture.channel().isActive()) {
|
||||
dstChannelFuture.channel().writeAndFlush(msg);
|
||||
} else {
|
||||
@ -37,7 +37,7 @@ public class NettyProxy2RealInboundHandler extends ChannelInboundHandlerAdapter
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
log.info("客户端与代理服务器的连接已经断开,即将断开代理服务器和目标服务器的连接");
|
||||
log.debug("客户端与代理服务器的连接已经断开,即将断开代理服务器和目标服务器的连接");
|
||||
if (dstChannelFuture.channel().isActive()) {
|
||||
if (ctx.channel().isActive()) {
|
||||
ctx.channel().writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||
|
Reference in New Issue
Block a user