【fix】 优化代理

This commit is contained in:
wujiawei 2025-04-08 16:41:14 +08:00
parent 50e67f54e3
commit 75acddadca
49 changed files with 446 additions and 371 deletions

View File

@ -7,6 +7,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -43,7 +44,7 @@ public class NettyHttpClientProxyClientProxyHandler extends SimpleChannelInbound
if (nextChannel != null) {
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(closeVisitorMsg);
}

View File

@ -5,6 +5,7 @@ import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyByteBuf;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
@ -28,7 +29,7 @@ public class NettyHttpClientProxyClientRealHandler extends SimpleChannelInboundH
// 访客通信通道 上报服务端代理完成
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel());
NettyProxyMsg returnMessage = new NettyProxyMsg();
returnMessage.setType(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_);
returnMessage.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_);
returnMessage.setVisitorId(visitorId);
returnMessage.setClientId(clientId);
returnMessage.setData(bytes);
@ -50,7 +51,7 @@ public class NettyHttpClientProxyClientRealHandler extends SimpleChannelInboundH
if (nextChannel != null) {
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(closeVisitorMsg);
}

View File

@ -5,6 +5,7 @@ import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
@ -44,7 +45,7 @@ public class NettyHttpClientProxyClientTransferRealHandler extends SimpleChannel
if (nextChannel != null) {
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(closeVisitorMsg);
}

View File

@ -7,6 +7,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
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.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -28,7 +29,7 @@ public class NettyHttpServerProxyClientRealHandler extends SimpleChannelInboundH
// 访客通信通道 上报服务端代理完成
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(ctx.channel());
NettyProxyMsg returnMessage = new NettyProxyMsg();
returnMessage.setType(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_);
returnMessage.setType(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_);
returnMessage.setVisitorId(visitorId);
returnMessage.setClientId(clientId);
returnMessage.setData(bytes);
@ -50,7 +51,7 @@ public class NettyHttpServerProxyClientRealHandler extends SimpleChannelInboundH
if (nextChannel != null) {
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setType(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(closeVisitorMsg);
}

View File

@ -7,6 +7,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -44,7 +45,7 @@ public class NettyHttpServerProxyClientTransferRealHandler extends SimpleChannel
if (nextChannel != null) {
// 上报关闭这个客户端的访客通道
NettyProxyMsg closeVisitorMsg = new NettyProxyMsg();
closeVisitorMsg.setType(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setType(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_);
closeVisitorMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(closeVisitorMsg);
}

View File

@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.config.NettyClientProperties;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.http.NettyHttpClientProxyClient;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.http.filter.NettyHttpClientProxyClientProxyFilter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -69,7 +69,7 @@ public class NettyHttpClientProxyClientProxySocket {
if (futureListener.isSuccess()) {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_);
// other clientId
nettyProxyMsg.setClientId(targetClientId);
nettyProxyMsg.setClientTargetIp(targetIp);

View File

@ -14,6 +14,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.NettyRealIdContext;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.HandleChannelTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -141,7 +142,7 @@ public class NettyHttpClientProxyClientRealSocket {
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setType(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
transferChannel.writeAndFlush(nettyProxyMsg);
ChannelAttributeKeyUtils.buildNextChannel(transferChannel, realChannel);

View File

@ -11,7 +11,7 @@ import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.http.NettyH
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.http.filter.NettyHttpClientProxyServerProxyFilter;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import java.util.concurrent.TimeUnit;
@ -72,7 +72,7 @@ public class NettyHttpClientProxyServerProxySocket {
if (futureListener.isSuccess()) {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_);
// other clientId
nettyProxyMsg.setClientId(clientId);

View File

@ -14,6 +14,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.NettyRealIdContext;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.HandleChannelTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
@ -141,7 +142,7 @@ public class NettyHttpServerProxyClientRealSocket {
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setType(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
transferChannel.writeAndFlush(nettyProxyMsg);
ChannelAttributeKeyUtils.buildNextChannel(transferChannel, realChannel);

View File

@ -20,6 +20,6 @@ public abstract class AbstractHttpClientProxyClientTypeAdvanced<MSG> extends Abs
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_CLIENT_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_CLIENT_PROXY_CLIENT_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHttpClientProxyServerTypeAdvanced<MSG> extends Abs
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHttpLocalProxyTypeAdvanced<MSG> extends AbstractHa
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_LOCAL_PROXY.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_LOCAL_PROXY.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyClientConnectionTra
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -16,7 +16,7 @@ public abstract class AbstractHandleHttpDistributeClientProxyClientTransferCLose
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -16,6 +16,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyClientTransferReque
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -15,6 +15,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyClientTransferRespo
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyServerClientRouteTy
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyServerServerRouteTy
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpDistributeClientProxyServerTransferTypeA
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -14,6 +14,6 @@ public abstract class AbstractHandleHttpDistributeServerProxyClientConnectionSuc
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -14,6 +14,6 @@ public abstract class AbstractHandleHttpDistributeServerProxyClientTransferReque
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpReportClientProxyClientConnectionTransfe
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpReportClientProxyClientTransferChannelIn
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -15,6 +15,6 @@ public abstract class AbstractHandleHttpReportClientProxyClientTransferCloseType
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -16,6 +16,6 @@ public abstract class AbstractHandleHttpReportClientProxyClientTransferResponseT
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpReportClientProxyServerTransferCloseType
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -20,6 +20,6 @@ public abstract class AbstractHandleHttpReportClientProxyServerTransferTypeAdvan
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -17,6 +17,6 @@ public abstract class AbstractHandleHttpReportServerProxyClientTransferChannelIn
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -3,7 +3,7 @@ package org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.se
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.AbstractHandleChannelTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.HandleChannelTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProxyMessageTypeEnums;
public abstract class AbstractHandleHttpReportServerProxyClientTransferCloseTypeAdvanced <MSG> extends AbstractHandleChannelTypeAdvanced<NettyProxyMsg> implements HandleChannelTypeAdvanced {
@ -17,6 +17,6 @@ public abstract class AbstractHandleHttpReportServerProxyClientTransferCloseType
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -17,6 +17,6 @@ public abstract class AbstractHandleHttpReportServerProxyClientTransferResponseT
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -16,6 +16,6 @@ public abstract class AbstractHttpServerProxyClientTypeAdvanced <MSG> extends Ab
*/
@Override
protected boolean doSupport(NettyProxyMsg nettyProxyMsg) {
return TcpMessageTypeEnums.HTTP_SERVER_PROXY_CLIENT_.getTypeByte() == nettyProxyMsg.getType();
return ProxyMessageTypeEnums.HTTP_SERVER_PROXY_CLIENT_.getTypeByte() == nettyProxyMsg.getType();
}
}

View File

@ -0,0 +1,209 @@
package org.framework.lazy.cloud.network.heartbeat.common.constant;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpClientProxyClientTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpClientProxyServerTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpLocalProxyTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.client.*;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.*;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;
/**
* http代理消息类型
* 90~120
* 数据取值范围 -128~ 127
* 当前约束范围 96~127
*/
public class ProxyMessageType {
/**
* http 本地代理
*
* @see TcpMessageTypeEnums#HTTP_LOCAL_PROXY
* @see AbstractHttpLocalProxyTypeAdvanced
*/
public static final byte HTTP_LOCAL_PROXY = 96;
/**
* http 远程客户端代理
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_CLIENT_
* @see AbstractHttpClientProxyClientTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_CLIENT_ = HTTP_LOCAL_PROXY + 1;
/**
* http 远程服务端代理
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_
* @see AbstractHttpClientProxyServerTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_ = HTTP_CLIENT_PROXY_CLIENT_ + 1;
/**
* http 远程服务端代理传输数据上报
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_
* @see AbstractHandleHttpReportClientProxyServerTransferTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_ = HTTP_CLIENT_PROXY_SERVER_ + 1;
/**
* http 远程代理服务通道关闭
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_
* @see AbstractHandleHttpReportClientProxyServerTransferCloseTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_ = HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_ + 1;
/**
* http 客户端远程客户端代理传输连接
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_
* @see AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_ = HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_ + 1;
/**
* http 目标客户端传输通道连接初始化成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportClientProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_ + 1;
/**
* http 另一个客户端将返回数据通过传输通道返回
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ + 1;
/**
* 上报传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpReportClientProxyClientTransferCloseTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ + 1;
/**
* http 服务端代理客户端
*
* @see TcpMessageTypeEnums#HTTP_SERVER_PROXY_CLIENT_
* @see AbstractHttpServerProxyClientTypeAdvanced
*/
public static final byte HTTP_SERVER_PROXY_CLIENT_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ + 1;
/**
* http 上报客户端连接成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ = HTTP_SERVER_PROXY_CLIENT_ + 1;
/**
* 下发返回结果
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ + 1;
/**
* 上报传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpReportServerProxyClientTransferCloseTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_ + 1;
public static final byte HTTP_DISTRIBUTE_PROXY = -96;
/**
* 下发服务端路由
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_
* @see AbstractHandleHttpDistributeClientProxyServerServerRouteTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_ = HTTP_DISTRIBUTE_PROXY - 1;
/**
* 下发客户端路由
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_
* @see AbstractHandleHttpDistributeClientProxyServerClientRouteTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_ = HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_ - 1;
/**
* http 下发服务端连接客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_
* @see AbstractHandleHttpDistributeServerProxyClientConnectionSuccessfulTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_ = HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_ - 1;
/**
* http 下发数据到另一个客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_
* @see AbstractHandleHttpDistributeServerProxyClientTransferRequestTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_ = HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_ - 1;
/**
* http 远程服务端代理传输数据下发
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_
* @see AbstractHandleHttpDistributeClientProxyServerTransferTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_ = HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_ - 1;
/**
* http 客户端代理客户端客户端连接服务端成功
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_
* @see AbstractHandleHttpDistributeClientProxyClientConnectionTransferSuccessfulTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_ = HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_ - 1;
/**
* 下发返回结果
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpDistributeClientProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_ - 1;
/**
* 下发传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpDistributeClientProxyClientTransferCLoseTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ - 1;
/**
* http 下发数据到另一个客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_
* @see AbstractHandleHttpDistributeClientProxyClientTransferRequestTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ - 1;
}

View File

@ -16,7 +16,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnu
* 当前约束范围 -100100
*
* TPC164
* UDP: 64~128
* UDP: 64~96
* HTTP: 96~127
*/
public class TcpMessageType {
/**
@ -218,184 +219,6 @@ public class TcpMessageType {
/**
* http 代理 ------------------------------------------------------------------------------------
* 90~120
*/
/**
* http 本地代理
* @see TcpMessageTypeEnums#HTTP_LOCAL_PROXY
* @see AbstractHttpLocalProxyTypeAdvanced
*
*/
public static final byte HTTP_LOCAL_PROXY = TCP_REPORT_CLIENT_PERMEATE_CLIENT_TRANSFER_CLOSE+1;
/**
* http 远程客户端代理
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_CLIENT_
* @see AbstractHttpClientProxyClientTypeAdvanced
*
*/
public static final byte HTTP_CLIENT_PROXY_CLIENT_ = HTTP_LOCAL_PROXY + 1;
/**
* http 远程服务端代理
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_
* @see AbstractHttpClientProxyServerTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_ = HTTP_CLIENT_PROXY_CLIENT_ + 1;
/**
* http 远程服务端代理传输数据上报
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_
* @see AbstractHandleHttpReportClientProxyServerTransferTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_ = HTTP_CLIENT_PROXY_SERVER_ + 1;
/**
* http 远程服务端代理传输数据下发
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_
* @see AbstractHandleHttpDistributeClientProxyServerTransferTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_ = HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_ + 1;
/**
* http 远程代理服务通道关闭
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_
* @see AbstractHandleHttpReportClientProxyServerTransferCloseTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_ = HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_ + 1;
/**
* 下发服务端路由
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_
* @see AbstractHandleHttpDistributeClientProxyServerServerRouteTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_ = HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_ + 1;
/**
* 下发客户端路由
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_
* @see AbstractHandleHttpDistributeClientProxyServerClientRouteTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_ = HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_ + 1;
/**
* http 客户端远程客户端代理传输连接
*
* @see TcpMessageTypeEnums#HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_
* @see AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced
*/
public static final byte HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_ = HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_ + 1;
/**
* http 客户端代理客户端客户端连接服务端成功
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_
* @see AbstractHandleHttpDistributeClientProxyClientConnectionTransferSuccessfulTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_ = HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_ + 1;
/**
* http 目标客户端传输通道连接初始化成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportClientProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_ + 1;
/**
* http 下发数据到另一个客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_
* @see AbstractHandleHttpDistributeClientProxyClientTransferRequestTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ + 1;
/**
* http 另一个客户端将返回数据通过传输通道返回
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_ + 1;
/**
* 下发返回结果
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpDistributeClientProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ + 1;
/**
* 上报传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpReportClientProxyClientTransferCloseTypeAdvanced
*/
public static final byte HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_ + 1;
/**
* 下发传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpDistributeClientProxyClientTransferCLoseTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ + 1;
/**
* http 服务端代理客户端
*
* @see TcpMessageTypeEnums#HTTP_SERVER_PROXY_CLIENT_
* @see AbstractHttpServerProxyClientTypeAdvanced
*/
public static final byte HTTP_SERVER_PROXY_CLIENT_ = HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_ + 1;
/**
* http 下发服务端连接客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_
* @see AbstractHandleHttpDistributeServerProxyClientConnectionSuccessfulTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_ = HTTP_SERVER_PROXY_CLIENT_ + 1;
/**
* http 上报客户端连接成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ = HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_ + 1;
/**
* http 下发数据到另一个客户端
*
* @see TcpMessageTypeEnums#HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_
* @see AbstractHandleHttpDistributeServerProxyClientTransferRequestTypeAdvanced
*/
public static final byte HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_ = HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_ + 1;
/**
* 下发返回结果
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_
* @see AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_ = HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_ + 1;
/**
* 上报传输通道关闭
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_
* @see AbstractHandleHttpReportServerProxyClientTransferCloseTypeAdvanced
*/
public static final byte HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_ = HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_ + 1;
/**
* 下发 客户端接收连接成功通知
*

View File

@ -12,7 +12,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.enums.UdpMessageTypeEnu
* 当前约束范围 -100100
*
* TPC164
* UDP: 64~128
* UDP: 64~96
* HTTP: 96~128
*/
public class UdpMessageType {

View File

@ -0,0 +1,158 @@
package org.framework.lazy.cloud.network.heartbeat.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.AbstractTcpHandleChannelHeartbeatTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client.*;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.server.*;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpClientProxyClientTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpClientProxyServerTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpLocalProxyTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.client.*;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.*;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
/**
* @see TcpMessageType
*/
@Getter
@AllArgsConstructor
public enum ProxyMessageTypeEnums {
/**
* http本地代理
*
* @see AbstractHttpLocalProxyTypeAdvanced
*/
HTTP_LOCAL_PROXY(ProxyMessageType.HTTP_LOCAL_PROXY, "http本地代理"),
/**
* http 远程客户端代理
*
* @see AbstractHttpClientProxyClientTypeAdvanced
*/
HTTP_CLIENT_PROXY_CLIENT_(ProxyMessageType.HTTP_CLIENT_PROXY_CLIENT_, "http远程客户端代理"),
/**
* http 远程服务端代理
* @see AbstractHttpClientProxyServerTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_(ProxyMessageType.HTTP_CLIENT_PROXY_SERVER_, "http远程服务端代理"),
/**
* http 远程服务端代理传输数据上报
* @see AbstractHandleHttpReportClientProxyServerTransferTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_, "http远程服务端代理传输数据上报"),
/**
* http 远程服务端代理传输数据下发
* @see AbstractHandleHttpDistributeClientProxyServerTransferTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_, "http远程服务端代理传输数据下发"),
/**
* http 远程代理服务通道关闭
* @see AbstractHandleHttpReportClientProxyServerTransferCloseTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_, "http远程服务端代理传输数据下发"),
/**
* http 下发服务端路由
* @see AbstractHandleHttpDistributeClientProxyServerServerRouteTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_, "http下发服务端路由"),
/**
* http 下发客户端路由
*
* @see AbstractHandleHttpDistributeClientProxyServerClientRouteTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_, "http下发客户端路由"),
/**
* http 客户端远程客户端代理传输连接
*
* @see AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_, "http 客户端远程客户端代理传输连接"),
/**
* http 客户端代理客户端客户端连接服务端成功
*
* @see AbstractHandleHttpDistributeClientProxyClientConnectionTransferSuccessfulTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_, "http 客户端代理客户端,客户端连接服务端成功"),
/**
* http 目标客户端传输通道连接初始化成功
*
* @see AbstractHandleHttpReportClientProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_, "http 目标客户端传输通道连接初始化成功"),
/**
* http 下发数据到另一个客户端
*
* @see AbstractHandleHttpDistributeClientProxyClientTransferRequestTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_, "http 下发数据到另一个客户端"),
/**
* http 另一个客户端将返回数据通过传输通道返回
*
* @see AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 另一个客户端将返回数据通过传输通道返回"),
/**
* 下发返回结果
*
* @see AbstractHandleHttpDistributeClientProxyClientTransferResponseTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 下发返回结果"),
/**
* 上报传输通道关闭
*
* @see AbstractHandleHttpReportClientProxyClientTransferCloseTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_, "http 上报传输通道关闭"),
/**
* 下发传输通道关闭
* @see AbstractHandleHttpDistributeClientProxyClientTransferCLoseTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_, "http 下发传输通道关闭"),
/**
* 服务端代理客户端
* @see AbstractHttpServerProxyClientTypeAdvanced
*/
HTTP_SERVER_PROXY_CLIENT_(ProxyMessageType.HTTP_SERVER_PROXY_CLIENT_, "http 服务端代理客户端"),
/**
* http 下发服务端连接客户端
*
* @see AbstractHandleHttpDistributeServerProxyClientConnectionSuccessfulTypeAdvanced
*/
HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_(ProxyMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_, "http 下发服务端连接客户端"),
/**
* http 上报客户端连接成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_, "http 上报客户端连接成功"),
/**
* 下发数据到另一个客户端
* @see AbstractHandleHttpDistributeServerProxyClientTransferRequestTypeAdvanced
*/
HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_(ProxyMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_, "http 下发数据到另一个客户端"),
/**
* 下发返回结果
* @see AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 下发返回结果"),
/**
* 上报传输通道关闭
* @see AbstractHandleHttpReportServerProxyClientTransferCloseTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_, "http 上报传输通道关闭"),
;
private final byte typeByte;
private final String desc;
}

View File

@ -10,6 +10,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.Abs
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.AbstractHttpLocalProxyTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.client.*;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.*;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
/**
@ -128,135 +129,6 @@ public enum TcpMessageTypeEnums {
TCP_REPORT_CLIENT_PERMEATE_CLIENT_TRANSFER_CLOSE(TcpMessageType.TCP_REPORT_CLIENT_PERMEATE_CLIENT_TRANSFER_CLOSE, "TCP 上报客户端渗透客户端通信通道关闭"),
/**
* http本地代理
*
* @see AbstractHttpLocalProxyTypeAdvanced
*/
HTTP_LOCAL_PROXY(TcpMessageType.HTTP_LOCAL_PROXY, "http本地代理"),
/**
* http 远程客户端代理
*
* @see AbstractHttpClientProxyClientTypeAdvanced
*/
HTTP_CLIENT_PROXY_CLIENT_(TcpMessageType.HTTP_CLIENT_PROXY_CLIENT_, "http远程客户端代理"),
/**
* http 远程服务端代理
* @see AbstractHttpClientProxyServerTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_, "http远程服务端代理"),
/**
* http 远程服务端代理传输数据上报
* @see AbstractHandleHttpReportClientProxyServerTransferTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_, "http远程服务端代理传输数据上报"),
/**
* http 远程服务端代理传输数据下发
* @see AbstractHandleHttpDistributeClientProxyServerTransferTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_, "http远程服务端代理传输数据下发"),
/**
* http 远程代理服务通道关闭
* @see AbstractHandleHttpReportClientProxyServerTransferCloseTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_, "http远程服务端代理传输数据下发"),
/**
* http 下发服务端路由
* @see AbstractHandleHttpDistributeClientProxyServerServerRouteTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_, "http下发服务端路由"),
/**
* http 下发客户端路由
*
* @see AbstractHandleHttpDistributeClientProxyServerClientRouteTypeAdvanced
*/
HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_, "http下发客户端路由"),
/**
* http 客户端远程客户端代理传输连接
*
* @see AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced
*/
HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_(TcpMessageType.HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_, "http 客户端远程客户端代理传输连接"),
/**
* http 客户端代理客户端客户端连接服务端成功
*
* @see AbstractHandleHttpDistributeClientProxyClientConnectionTransferSuccessfulTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_, "http 客户端代理客户端,客户端连接服务端成功"),
/**
* http 目标客户端传输通道连接初始化成功
*
* @see AbstractHandleHttpReportClientProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_, "http 目标客户端传输通道连接初始化成功"),
/**
* http 下发数据到另一个客户端
*
* @see AbstractHandleHttpDistributeClientProxyClientTransferRequestTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_, "http 下发数据到另一个客户端"),
/**
* http 另一个客户端将返回数据通过传输通道返回
*
* @see AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 另一个客户端将返回数据通过传输通道返回"),
/**
* 下发返回结果
*
* @see AbstractHandleHttpDistributeClientProxyClientTransferResponseTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 下发返回结果"),
/**
* 上报传输通道关闭
*
* @see AbstractHandleHttpReportClientProxyClientTransferCloseTypeAdvanced
*/
HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_(TcpMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_, "http 上报传输通道关闭"),
/**
* 下发传输通道关闭
* @see AbstractHandleHttpDistributeClientProxyClientTransferCLoseTypeAdvanced
*/
HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_, "http 下发传输通道关闭"),
/**
* 服务端代理客户端
* @see AbstractHttpServerProxyClientTypeAdvanced
*/
HTTP_SERVER_PROXY_CLIENT_(TcpMessageType.HTTP_SERVER_PROXY_CLIENT_, "http 服务端代理客户端"),
/**
* http 下发服务端连接客户端
*
* @see AbstractHandleHttpDistributeServerProxyClientConnectionSuccessfulTypeAdvanced
*/
HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_(TcpMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_, "http 下发服务端连接客户端"),
/**
* http 上报客户端连接成功
*
* @see TcpMessageTypeEnums#HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_
* @see AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_, "http 上报客户端连接成功"),
/**
* 下发数据到另一个客户端
* @see AbstractHandleHttpDistributeServerProxyClientTransferRequestTypeAdvanced
*/
HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_(TcpMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_, "http 下发数据到另一个客户端"),
/**
* 下发返回结果
* @see AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_RESPONSE_, "http 下发返回结果"),
/**
* 上报传输通道关闭
* @see AbstractHandleHttpReportServerProxyClientTransferCloseTypeAdvanced
*/
HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_(TcpMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CLOSE_, "http 上报传输通道关闭"),

View File

@ -9,7 +9,7 @@ import io.netty.handler.codec.http.FullHttpRequest;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.ClientProxyRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.ProxyRoute;
@ -88,22 +88,22 @@ public class NettyHttpProxyHandler extends ChannelInboundHandlerAdapter {
ProxyRoute route = RouteContext.getRoute(host, String.valueOf(port));
if(ObjectUtils.isEmpty(route)){
proxyMsg.setType(TcpMessageType.HTTP_LOCAL_PROXY);
proxyMsg.setType(ProxyMessageType.HTTP_LOCAL_PROXY);
}else {
if(RouteType.LOCAL.equals(route.getRouteType())){
proxyMsg.setType(TcpMessageType.HTTP_LOCAL_PROXY);
proxyMsg.setType(ProxyMessageType.HTTP_LOCAL_PROXY);
}else if (RouteType.CLIENT_PROXY_CLIENT.equals(route.getRouteType())){
ClientProxyRoute clientProxyRoute= (ClientProxyRoute) route;
String clientId = clientProxyRoute.getClientId();
proxyMsg.setClientId(clientId);
proxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_CLIENT_);
proxyMsg.setType(ProxyMessageType.HTTP_CLIENT_PROXY_CLIENT_);
}else if (RouteType.CLIENT_PROXY_SEVER.equals(route.getRouteType())){
proxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_);
proxyMsg.setType(ProxyMessageType.HTTP_CLIENT_PROXY_SERVER_);
}else if (RouteType.SERVER_PROXY_CLIENT.equals(route.getRouteType())){
ClientProxyRoute clientProxyRoute= (ClientProxyRoute) route;
String clientId = clientProxyRoute.getClientId();
proxyMsg.setClientId(clientId);
proxyMsg.setType(TcpMessageType.HTTP_SERVER_PROXY_CLIENT_);
proxyMsg.setType(ProxyMessageType.HTTP_SERVER_PROXY_CLIENT_);
}
}
channelTypeAdapter.handler(ctx.channel(), proxyMsg);
@ -122,7 +122,7 @@ public class NettyHttpProxyHandler extends ChannelInboundHandlerAdapter {
// close
NettyProxyMsg closeMes=new NettyProxyMsg();
closeMes.setVisitorId(visitorId);
closeMes.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_);
closeMes.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_);
nextChannel.writeAndFlush(closeMes);
closeOnFlush(nextChannel);
}

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.server.AbstractHandleTcpClientConnectSuccessTypeAdvanced;
@ -201,7 +202,7 @@ public class ServerHandleTcpClientConnectSuccessTypeAdvanced extends AbstractHan
serverProxyRoute.setAllowPort(routePort);
serverProxyRoute.setRouteType(RouteType.CLIENT_PROXY_SEVER);
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_);
nettyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_);
nettyMsg.setData((JSON.toJSONString(serverProxyRoute)
.getBytes(StandardCharsets.UTF_8)));
newChannel.writeAndFlush(nettyMsg);
@ -224,7 +225,7 @@ public class ServerHandleTcpClientConnectSuccessTypeAdvanced extends AbstractHan
clientProxyRoute.setAllowPort(routePort);
clientProxyRoute.setRouteType(RouteType.CLIENT_PROXY_CLIENT);
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_);
nettyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_);
nettyMsg.setData((JSON.toJSONString(clientProxyRoute)
.getBytes(StandardCharsets.UTF_8)));
newChannel.writeAndFlush(nettyMsg);

View File

@ -8,6 +8,7 @@ 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.NettyTransferChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.beans.factory.config.BeanDefinition;
@ -17,7 +18,7 @@ import org.springframework.stereotype.Component;
/**
* 服务端处理客户端代理到服务端的请求
* HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_
* HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j
@ -56,7 +57,7 @@ public class ServerHandleHttpReportClientProxyClientConnectTransferTypeAdvanced
clientConnectTagetNettyProxyMsg.setClientTargetIp(targetIpString);
clientConnectTagetNettyProxyMsg.setClientTargetPort(Integer.parseInt(targetPortString));
clientConnectTagetNettyProxyMsg.setClientId(clientId);
clientConnectTagetNettyProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_);
clientConnectTagetNettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_SUCCESSFUL_);
if (loadBalance != null) {
// 让客户端主动创建一个数据传输通道
loadBalance.writeAndFlush(clientConnectTagetNettyProxyMsg);

View File

@ -7,6 +7,7 @@ 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.NettyTransferChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientTransferChannelInitSuccessfulTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.beans.factory.config.BeanDefinition;
@ -59,7 +60,7 @@ public class ServerHandleHttpReportClientProxyClientTransferChannelInitSuccessfu
clientConnectTagetNettyProxyMsg.setClientId(clientId);
clientConnectTagetNettyProxyMsg.setData(nettyByteBufData.getData());
clientConnectTagetNettyProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_);
clientConnectTagetNettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_REQUEST_);
transferChannel.writeAndFlush(clientConnectTagetNettyProxyMsg);

View File

@ -7,6 +7,7 @@ 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.NettyTransferChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientTransferCloseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.beans.factory.config.BeanDefinition;
@ -43,7 +44,7 @@ public class ServerHandleHttpReportClientProxyClientTransferCloseTypeAdvanced
// 下发关闭客户端真实通道
NettyProxyMsg closeTransferNettyProxyMsg = new NettyProxyMsg();
closeTransferNettyProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
closeTransferNettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_CLOSE_);
transferNextChannel.writeAndFlush(closeTransferNettyProxyMsg);
channel.close();

View File

@ -5,6 +5,7 @@ import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.beans.factory.config.BeanDefinition;
@ -15,7 +16,7 @@ import org.wu.framework.core.utils.ObjectUtils;
/**
* 服务端处理客户端代理到服务端的请求
* HTTP_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_REPORT_
* HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j
@ -39,7 +40,7 @@ public class ServerHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
log.info("目标客户端返回数据通过服务端下发到原始通道");
NettyProxyMsg responseProxyMsg = new NettyProxyMsg();
responseProxyMsg.setData(nettyProxyMsg.getData());
responseProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_);
responseProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_CLIENT_TRANSFER_RESPONSE_);
transferNextChannel.writeAndFlush(responseProxyMsg);
}else {
log.error("无法将数据下发给原始客户端");

View File

@ -20,7 +20,7 @@ import java.util.List;
/**
* 服务端处理客户端代理到服务端的请求
* HTTP_CLIENT_PROXY_SERVER_TRANSFER_REPORT_
* HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j

View File

@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
/**
* 远程代理服务通道关闭
* HTTP_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_REPORT_
* HTTP_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CLOSE_
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j

View File

@ -57,7 +57,7 @@ public class ServerHandleHttpReportServerProxyClientTransferChannelInitSuccessfu
clientConnectTagetNettyProxyMsg.setClientId(clientId);
clientConnectTagetNettyProxyMsg.setData(nettyByteBufData.getData());
clientConnectTagetNettyProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_);
clientConnectTagetNettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_TRANSFER_REQUEST_);
transferChannel.writeAndFlush(clientConnectTagetNettyProxyMsg);

View File

@ -8,6 +8,7 @@ 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.NettyTransferChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHttpServerProxyClientTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.beans.factory.config.BeanDefinition;
@ -53,7 +54,7 @@ public class ServerHandleHttpReportServerProxyClientTransferTypeAdvanced
clientConnectTagetNettyProxyMsg.setClientTargetIp(targetIpString);
clientConnectTagetNettyProxyMsg.setClientTargetPort(Integer.parseInt(targetPortString));
clientConnectTagetNettyProxyMsg.setClientId(clientId);
clientConnectTagetNettyProxyMsg.setType(TcpMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_);
clientConnectTagetNettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_SERVER_PROXY_CLIENT_CONNECTION_SUCCESSFUL_);
if (loadBalance != null) {
// 让客户端主动创建一个数据传输通道
loadBalance.writeAndFlush(clientConnectTagetNettyProxyMsg);

View File

@ -8,7 +8,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
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.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
/**
@ -39,7 +39,7 @@ public class NettyHttpClientProxyServerRealHandler extends SimpleChannelInboundH
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(channel);
// 将数据返回给客户端
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_TRANSFER_DISTRIBUTE_);
nettyProxyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_TRANSFER_);
nettyProxyMsg.setData(bytes);
nextChannel.writeAndFlush(nettyProxyMsg);

View File

@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import io.netty.channel.Channel;
import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.ClientProxyRoute;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.RouteContext;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.RouteType;
@ -73,7 +73,7 @@ public class LazyNettyClientRouteRepositoryImpl implements LazyNettyClientRout
// 发送所有客户端本地路由刷新
ChannelContext.getChannels().forEach((channelClientId, channels) -> {
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_CLIENT_ROUTE_DISTRIBUTE_);
nettyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_CLIENT_ROUTE_);
nettyMsg.setData((JSON.toJSONString(clientProxyRoute)
.getBytes(StandardCharsets.UTF_8)));
// 发送所有客户端ID

View File

@ -4,13 +4,12 @@ import com.alibaba.fastjson.JSON;
import io.netty.channel.Channel;
import org.framework.lazy.cloud.network.heartbeat.common.ChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.RouteContext;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.RouteType;
import org.framework.lazy.cloud.network.heartbeat.protocol.route.ServerProxyRoute;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.entity.LazyNettyServerRouteDO;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.converter.LazyNettyServerRouteConverter;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.infrastructure.mapper.LazyNettyServerRouteMapper;
import org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.model.lazy.netty.server.route.LazyNettyServerRouteRepository;
import org.springframework.stereotype.Repository;
@ -71,7 +70,7 @@ public class LazyNettyServerRouteRepositoryImpl implements LazyNettyServerRout
// 发送所有客户端本地路由刷新
ChannelContext.getChannels().forEach((clientId, channels) -> {
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(TcpMessageType.HTTP_CLIENT_PROXY_SERVER_SERVER_ROUTE_DISTRIBUTE_);
nettyMsg.setType(ProxyMessageType.HTTP_DISTRIBUTE_CLIENT_PROXY_SERVER_SERVER_ROUTE_);
nettyMsg.setData((JSON.toJSONString(clientProxyServerRoute)
.getBytes(StandardCharsets.UTF_8)));
// 发送所有客户端ID