mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-16 10:25:07 +08:00
【fix】客户端代理客户端
This commit is contained in:
@ -14,7 +14,6 @@ import org.framework.lazy.cloud.network.heartbeat.common.NettyTransferChannelCon
|
||||
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.server.AbstractHandleSocksReportClientProxyClientConnectionTransferTypeAdvanced;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyServerConnectionTransferTypeAdvanced;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.factory.EventLoopGroupFactory;
|
||||
@ -49,19 +48,23 @@ public class ServerHandleSocksReportClientProxyClientConnectTransferTypeAdvanced
|
||||
Integer port = Integer.parseInt(nettyProxyMsg.getTargetPortString());
|
||||
byte[] data = nettyProxyMsg.getData();
|
||||
byte[] visitorId = nettyProxyMsg.getVisitorId();
|
||||
byte[] clientId = nettyProxyMsg.getClientId();
|
||||
byte[] targetClientId = nettyProxyMsg.getClientId();
|
||||
String msgVisitorId = new String(visitorId);
|
||||
ChannelAttributeKeyUtils.buildClientId(transferChannel, clientId);
|
||||
ChannelAttributeKeyUtils.buildClientId(transferChannel, targetClientId);
|
||||
ChannelAttributeKeyUtils.buildVisitorId(transferChannel, msgVisitorId);
|
||||
|
||||
NettyTransferChannelContext.pushVisitor(transferChannel, msgVisitorId);
|
||||
|
||||
// 客户端连接客户端传输通道
|
||||
Channel loadBalance = ChannelContext.getLoadBalance(clientId);
|
||||
Channel loadBalance = ChannelContext.getLoadBalance(targetClientId);
|
||||
if(ObjectUtils.isNotEmpty(loadBalance)) {
|
||||
// 下发创建新链接指令
|
||||
NettyProxyMsg otherClientConnectServer = new NettyProxyMsg();
|
||||
otherClientConnectServer.setData(data);
|
||||
otherClientConnectServer.setClientTargetIp(host);
|
||||
otherClientConnectServer.setClientTargetPort(port);
|
||||
otherClientConnectServer.setVisitorId(visitorId);
|
||||
otherClientConnectServer.setClientId(targetClientId);
|
||||
otherClientConnectServer.setType(ProxyMessageType.SOCKS_DISTRIBUTE_CLIENT_PROXY_CLIENT_OTHER_TRANSFER_CONNECTION_);
|
||||
loadBalance.writeAndFlush(otherClientConnectServer);
|
||||
|
||||
|
Reference in New Issue
Block a user