【fix】 bug fix

This commit is contained in:
wujiawei 2025-04-06 22:54:57 +08:00
parent 9c5000f995
commit 26283de998
3 changed files with 7 additions and 5 deletions

View File

@ -32,6 +32,8 @@ public class ClientHandleHttpDistributeClientProxyClientTransferResponseTypeAdva
ByteBuf buf = channel.config().getAllocator().buffer(nettyProxyMsg.getData().length); ByteBuf buf = channel.config().getAllocator().buffer(nettyProxyMsg.getData().length);
buf.writeBytes(nettyProxyMsg.getData()); buf.writeBytes(nettyProxyMsg.getData());
nextChannel.writeAndFlush(buf); nextChannel.writeAndFlush(buf);
}else {
} }
// 关闭连接 // 关闭连接

View File

@ -57,7 +57,7 @@ public class NettyHttpClientProxyClientRealSocket {
if (future.isSuccess()) { if (future.isSuccess()) {
// 客户端链接真实服务成功 设置自动读写false 等待访客连接成功后设置成true // 客户端链接真实服务成功 设置自动读写false 等待访客连接成功后设置成true
Channel realChannel = future.channel(); Channel realChannel = future.channel();
realChannel.config().setOption(ChannelOption.AUTO_READ, false); // realChannel.config().setOption(ChannelOption.AUTO_READ, false);
log.info("访客通过 客户端:【{}】,visitorId:{},绑定本地服务,IP:{},端口:{} 新建通道成功", clientId, visitorId, clientTargetIp, clientTargetPort); log.info("访客通过 客户端:【{}】,visitorId:{},绑定本地服务,IP:{},端口:{} 新建通道成功", clientId, visitorId, clientTargetIp, clientTargetPort);
// 客户端真实通道 // 客户端真实通道

View File

@ -3,10 +3,7 @@ package org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.http.advan
import io.netty.channel.Channel; import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.NettyByteBuf;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg; import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.NettyTransferChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -39,7 +36,10 @@ public class ServerHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
Channel transferNextChannel = ChannelAttributeKeyUtils.getTransferNextChannel(transferChannel); Channel transferNextChannel = ChannelAttributeKeyUtils.getTransferNextChannel(transferChannel);
if(ObjectUtils.isNotEmpty(transferNextChannel)) { if(ObjectUtils.isNotEmpty(transferNextChannel)) {
transferNextChannel.writeAndFlush(nettyProxyMsg); NettyProxyMsg responseProxyMsg = new NettyProxyMsg();
responseProxyMsg.setData(nettyProxyMsg.getData());
responseProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_);
transferNextChannel.writeAndFlush(responseProxyMsg);
}else { }else {
log.error("无法将数据下发给原始客户端"); log.error("无法将数据下发给原始客户端");
} }