【fix】error

This commit is contained in:
wujiawei 2025-05-08 09:47:44 +08:00
parent 68f4c92366
commit 32c757ef5e
2 changed files with 6 additions and 11 deletions

View File

@ -42,9 +42,6 @@ public class ClientHandleSocksDistributeServerProxyClientConnectionInitTypeAdvan
String targetIp = nettyProxyMsg.getTargetIpString();
Integer targetPort = Integer.parseInt(nettyProxyMsg.getTargetPortString());
byte[] data = nettyProxyMsg.getData();
byte socks5AddressType = data[0];
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
NettyClientProperties nettyClientProperties = SpringContextHolder.getBean(NettyClientProperties.class);
@ -57,7 +54,6 @@ public class ClientHandleSocksDistributeServerProxyClientConnectionInitTypeAdvan
nettySocksClientProxyClient.setTargetPort(targetPort);
ChannelAttributeKeyUtils.buildVisitorId(channel, visitorId);
ChannelAttributeKeyUtils.buildSocks5AddressType(channel,socks5AddressType);
// 创建真实通道
NettySocksServerProxyClientRealSocket.buildRealServer(

View File

@ -8,6 +8,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.NettyTransferChannelContext;
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.payload.NettySocketChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportServerProxyClientTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -32,16 +33,15 @@ public class ServerHandleSocksReportServerProxyClientTypeAdvanced
*/
@Override
public void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel visitorrChannel = nettyChannelContext.channel();
NettySocketChannelContext nettySocketChannelContext = (NettySocketChannelContext) nettyChannelContext;
Channel visitorrChannel = nettySocketChannelContext.channel();
String host = nettyProxyMsg.getTargetIpString();
Integer port = Integer.parseInt(nettyProxyMsg.getTargetPortString());
byte[] data = nettyProxyMsg.getData();
byte[] visitorId = nettyProxyMsg.getVisitorId();
byte[] targetClientId = nettyProxyMsg.getClientId();
byte socks5AddressTypeByte = data[0];
Socks5AddressType socks5AddressType = nettySocketChannelContext.getSocks5AddressType();
byte socks5AddressTypeByte = socks5AddressType.byteValue();
String msgVisitorId = new String(visitorId);
ChannelAttributeKeyUtils.buildVisitorId(visitorrChannel, msgVisitorId);
@ -54,7 +54,6 @@ public class ServerHandleSocksReportServerProxyClientTypeAdvanced
// 下发创建新链接指令
NettyProxyMsg otherClientConnectServer = new NettyProxyMsg();
// data ---Socks5AddressType
otherClientConnectServer.setData(data);
otherClientConnectServer.setClientTargetIp(host);
otherClientConnectServer.setClientTargetPort(port);
otherClientConnectServer.setVisitorId(visitorId);