[fix] 添加namespace

This commit is contained in:
wujiawei
2025-06-11 16:19:11 +08:00
parent 51b603a6c5
commit 3163987ef7
208 changed files with 1011 additions and 828 deletions

View File

@ -30,8 +30,8 @@ public class HttpClientProxyClientProxyTypeAdvanced extends AbstractHttpClientPr
@Override
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel channel = nettyChannelContext.channel();
String targetPortString = nettyProxyMsg.getTargetPortString();
String targetIpString = nettyProxyMsg.getTargetIpString();
String targetPortString = nettyProxyMsg.targetPort();
String targetIpString = nettyProxyMsg.targetIp();
Bootstrap b = new Bootstrap();
b.group(channel.eventLoop())
.channel(NioSocketChannel.class)

View File

@ -29,8 +29,8 @@ public class HttpProtocolHandleChannelLocalProxyTypeAdvanced extends AbstractHtt
*/
@Override
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
String targetPortString = nettyProxyMsg.getTargetPortString();
String targetIpString = nettyProxyMsg.getTargetIpString();
String targetPortString = nettyProxyMsg.targetPort();
String targetIpString = nettyProxyMsg.targetIp();
Bootstrap b = new Bootstrap();
Channel channel = nettyChannelContext.channel();
b.group(channel.eventLoop())

View File

@ -37,8 +37,8 @@ public class NettySocketProtocolHandleSocketLocalProxyTypeAdvanced
Channel channel = nettySocketChannelContext.channel();
ChannelHandlerContext channelHandlerContext = nettySocketChannelContext.channelHandlerContext();
EventLoopGroup group = EventLoopGroupFactory.createClientWorkGroup();
String host = nettyProxyMsg.getTargetIpString();
Integer port = Integer.parseInt(nettyProxyMsg.getTargetPortString());
String host = nettyProxyMsg.targetIp();
Integer port = Integer.parseInt(nettyProxyMsg.targetPort());
Bootstrap b = new Bootstrap();
Socks5AddressType socks5AddressType = nettySocketChannelContext.getSocks5AddressType();

View File

@ -83,11 +83,11 @@ public class NettyHttpProxyHandler extends ChannelInboundHandlerAdapter {
ProxyRoute route = RouteContext.getRoute(originHost, String.valueOf(originPort));
String namespace = route.getNamespace();
proxyMsg.setVisitorId(visitorId);
proxyMsg.setData(bytes);
proxyMsg.setNamespace(namespace);
if(ObjectUtils.isEmpty(route)){
// 本地代理

View File

@ -60,7 +60,8 @@ public class NettySocks5CommandRequestHandler extends SimpleChannelInboundHandle
proxyMsg.setVisitorId(visitorId);
ProxyRoute route = RouteContext.getRoute(originHost, String.valueOf(originPort));
String namespace = route.getNamespace();
proxyMsg.setNamespace(namespace);
if(ObjectUtils.isEmpty(route)){

View File

@ -24,6 +24,10 @@ public class ClientProxyRoute implements ProxyRoute{
* 虚拟端口
*/
private String virtualPort;
/**
* 命名空间
*/
private String namespace;
/**
*

View File

@ -6,6 +6,9 @@ package org.framework.lazy.cloud.network.heartbeat.protocol.route;
public interface ProxyRoute {
String getNamespace();
String getVirtualIp();

View File

@ -9,6 +9,11 @@ import lombok.Data;
@Data
public class ServerProxyRoute implements ProxyRoute {
/**
* 命名空间
*/
private String namespace;
/**
*
* 服务端ip