mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-16 10:25:07 +08:00
【fix】init route ip
This commit is contained in:
@ -15,7 +15,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
|
||||
import org.framework.lazy.cloud.network.heartbeat.protocol.handler.NettySocks5CommandRequestHandler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.filter.NettySocksServerProxyClientVisitorFilter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettyServerProxyClientVisitorInboundHandler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksServerProxyClientVisitorInboundHandler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Role;
|
||||
@ -56,7 +56,7 @@ public class ServerHandleSocksReportServerProxyClientConnectionSuccessTypeAdvanc
|
||||
// TODO bug fix
|
||||
nextChannel.pipeline().addLast(new TransferDecoder(Integer.MAX_VALUE, 1024 * 1024*10));
|
||||
// 请求数据开始上报
|
||||
nextChannel.pipeline().addLast(new NettyServerProxyClientVisitorInboundHandler());
|
||||
nextChannel.pipeline().addLast(new NettySocksServerProxyClientVisitorInboundHandler());
|
||||
DefaultSocks5CommandResponse commandResponse =
|
||||
new DefaultSocks5CommandResponse(Socks5CommandStatus.SUCCESS, socks5AddressType);
|
||||
nextChannel.writeAndFlush(commandResponse);
|
||||
|
@ -15,7 +15,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeK
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class NettyServerProxyClientVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
|
||||
public class NettySocksServerProxyClientVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ public class NettyServerProxyClientVisitorInboundHandler extends SimpleChannelIn
|
||||
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(channel);
|
||||
|
||||
if (nextChannel.isActive()) {
|
||||
// 上报数据到服务端
|
||||
// 下发数据到服务端
|
||||
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
|
||||
nettyProxyMsg.setType(ProxyMessageType.SOCKS_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_);
|
||||
|
||||
@ -62,11 +62,12 @@ public class NettyServerProxyClientVisitorInboundHandler extends SimpleChannelIn
|
||||
ctx.channel().writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
|
||||
}
|
||||
}
|
||||
super.channelInactive(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
log.error("【socks】NettyServerProxyClientVisitorInboundHandler exception", cause);
|
||||
log.error("【socks】NettySocksServerProxyClientVisitorInboundHandler exception", cause);
|
||||
ctx.close();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user