【fix】init route ip

This commit is contained in:
wujiawei
2025-05-13 21:32:19 +08:00
parent 32a641ce99
commit 7f9cebec8a
6 changed files with 15 additions and 16 deletions

View File

@ -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);

View File

@ -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();
}
}