【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

@ -6,12 +6,10 @@ import io.netty.handler.codec.socksx.v5.Socks5AddressType;
import io.netty.handler.codec.socksx.v5.Socks5CommandRequestDecoder;
import io.netty.handler.codec.socksx.v5.Socks5CommandStatus;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.handler.NettyClientProxyClientVisitorInboundHandler;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.handler.NettyClientProxyServerVisitorInboundHandler;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.handler.NettySocksClientProxyClientVisitorInboundHandler;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.client.AbstractHandleSocksDistributeClientProxyClientConnectionTransferSuccessTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.client.AbstractHandleSocksDistributeClientProxyServerConnectionTransferSuccessTypeAdvanced;
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;
@ -45,7 +43,7 @@ public class ClientHandleDistributeSocksClientProxyClientConnectionTransferSucce
// TODO bug fix
nextChannel.pipeline().addLast(new TransferDecoder(Integer.MAX_VALUE, 1024 * 1024*10));
// 请求数据开始上报
nextChannel.pipeline().addLast(new NettyClientProxyClientVisitorInboundHandler());
nextChannel.pipeline().addLast(new NettySocksClientProxyClientVisitorInboundHandler());
DefaultSocks5CommandResponse commandResponse =
new DefaultSocks5CommandResponse(Socks5CommandStatus.SUCCESS, socks5AddressType);
nextChannel.writeAndFlush(commandResponse);

View File

@ -6,7 +6,7 @@ import io.netty.handler.codec.socksx.v5.Socks5AddressType;
import io.netty.handler.codec.socksx.v5.Socks5CommandRequestDecoder;
import io.netty.handler.codec.socksx.v5.Socks5CommandStatus;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.handler.NettyClientProxyServerVisitorInboundHandler;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.handler.NettySocksClientProxyServerVisitorInboundHandler;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.client.AbstractHandleSocksDistributeClientProxyServerConnectionTransferSuccessTypeAdvanced;
@ -43,7 +43,7 @@ public class ClientHandleDistributeSocksClientProxyServerConnectionTransferSucce
// TODO bug fix
nextChannel.pipeline().addLast(new TransferDecoder(Integer.MAX_VALUE, 1024 * 1024*10));
// 请求数据开始上报
nextChannel.pipeline().addLast(new NettyClientProxyServerVisitorInboundHandler(transferChannel));
nextChannel.pipeline().addLast(new NettySocksClientProxyServerVisitorInboundHandler(transferChannel));
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 NettyClientProxyClientVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
public class NettySocksClientProxyClientVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
@ -66,7 +66,7 @@ public class NettyClientProxyClientVisitorInboundHandler extends SimpleChannelIn
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
log.error("【socks】NettyClientProxyServerVisitorInboundHandler exception", cause);
log.error("【socks】NettySocksClientProxyServerVisitorInboundHandler exception", cause);
ctx.close();
}
}

View File

@ -12,11 +12,11 @@ import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeK
@Slf4j
public class NettyClientProxyServerVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
public class NettySocksClientProxyServerVisitorInboundHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
private final Channel transferChannel;
public NettyClientProxyServerVisitorInboundHandler(Channel transferChannel) {
public NettySocksClientProxyServerVisitorInboundHandler(Channel transferChannel) {
this.transferChannel = transferChannel;
}
@ -67,7 +67,7 @@ public class NettyClientProxyServerVisitorInboundHandler extends SimpleChannelIn
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
log.error("【socks】NettyClientProxyServerVisitorInboundHandler exception", cause);
log.error("【socks】NettySocksClientProxyServerVisitorInboundHandler exception", cause);
ctx.close();
}
}