[fix] socks、http代理 添加流量计费

This commit is contained in:
wujiawei 2025-06-06 23:13:01 +08:00
parent 9cd85abe1d
commit ddb709c3a8
17 changed files with 70 additions and 73 deletions

View File

@ -1,8 +1,8 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy; package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
public interface ChannelProxyFlow { public interface ChannelProxyFlow {
@ -36,15 +36,15 @@ public interface ChannelProxyFlow {
/** /**
* 代理流量类型 * 代理流量类型
* @see ChannelProxyFlowTypeEnum * @see ChannelProtocolType
*/ */
ChannelProxyFlowTypeEnum channelProxyFlowTypeEnum(); ChannelProtocolType channelProtocolType();
/** /**
* 代理类型 * 代理类型
* @see ChannelProxyTypeEnum * @see ChannelProxyType
*/ */
ChannelProxyTypeEnum channelProxyTypeEnum(); ChannelProxyType channelProxyType();
/** /**
* 流量 * 流量

View File

@ -8,7 +8,7 @@ import lombok.Getter;
*/ */
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum ChannelProxyFlowTypeEnum { public enum ChannelProtocolType {
// HTTP // HTTP
HTTP, HTTP,

View File

@ -8,7 +8,7 @@ import lombok.Getter;
*/ */
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum ChannelProxyTypeEnum { public enum ChannelProxyType {
SERVER_PROXY_SERVER("服务端代理服务端"), SERVER_PROXY_SERVER("服务端代理服务端"),
SERVER_PROXY_CLIENT("服务端远程客户端"), SERVER_PROXY_CLIENT("服务端远程客户端"),

View File

@ -312,12 +312,12 @@ public class ServerAutoConfiguration {
return new ServerHandleSocksReportServerProxyClientConnectionSuccessTypeAdvanced(); return new ServerHandleSocksReportServerProxyClientConnectionSuccessTypeAdvanced();
} }
@Bean @Bean
public ServerHandleSocksReportServerProxyClientResponseTypeAdvanced serverHandleSocksReportServerProxyClientResponseTypeAdvanced(){ public ServerHandleSocksReportServerProxyClientResponseTypeAdvanced serverHandleSocksReportServerProxyClientResponseTypeAdvanced(ChannelProxyFlowAdapter channelProxyFlowAdapter){
return new ServerHandleSocksReportServerProxyClientResponseTypeAdvanced(); return new ServerHandleSocksReportServerProxyClientResponseTypeAdvanced(channelProxyFlowAdapter);
} }
@Bean @Bean
public ServerHandleSocksReportServerProxyClientRequestTypeAdvanced serverHandleSocksReportServerProxyClientRequestTypeAdvanced(){ public ServerHandleSocksReportServerProxyClientRequestTypeAdvanced serverHandleSocksReportServerProxyClientRequestTypeAdvanced(ChannelProxyFlowAdapter channelProxyFlowAdapter){
return new ServerHandleSocksReportServerProxyClientRequestTypeAdvanced(); return new ServerHandleSocksReportServerProxyClientRequestTypeAdvanced(channelProxyFlowAdapter);
} }
@Bean @Bean
public ServerHandleSocksReportServerProxyClientTransferCloseTypeAdvanced serverHandleSocksReportServerProxyClientTransferCloseTypeAdvanced(){ public ServerHandleSocksReportServerProxyClientTransferCloseTypeAdvanced serverHandleSocksReportServerProxyClientTransferCloseTypeAdvanced(){

View File

@ -4,8 +4,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.ChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.ChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
@Builder @Builder
@Data @Data
@ -14,8 +14,8 @@ public class ServerChannelProxyFlow implements ChannelProxyFlow {
private String ip; private String ip;
private Integer port; private Integer port;
private ChannelFlowEnum channelFlowEnum; private ChannelFlowEnum channelFlowEnum;
private ChannelProxyFlowTypeEnum channelProxyFlowTypeEnum; private ChannelProtocolType channelProtocolType;
private ChannelProxyTypeEnum channelProxyTypeEnum; private ChannelProxyType channelProxyType;
private Integer flow; private Integer flow;
/** /**
@ -62,21 +62,21 @@ public class ServerChannelProxyFlow implements ChannelProxyFlow {
/** /**
* 代理流量类型 * 代理流量类型
* *
* @see ChannelProxyFlowTypeEnum * @see ChannelProtocolType
*/ */
@Override @Override
public ChannelProxyFlowTypeEnum channelProxyFlowTypeEnum() { public ChannelProtocolType channelProtocolType() {
return channelProxyFlowTypeEnum; return channelProtocolType;
} }
/** /**
* 代理类型 * 代理类型
* *
* @see ChannelProxyTypeEnum * @see ChannelProxyType
*/ */
@Override @Override
public ChannelProxyTypeEnum channelProxyTypeEnum() { public ChannelProxyType channelProxyType() {
return channelProxyTypeEnum; return channelProxyType;
} }
/** /**

View File

@ -12,8 +12,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyC
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyClientConnectionTransferTypeAdvanced; 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.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
@ -87,8 +87,8 @@ public class ServerHandleHttpReportClientProxyClientTransferRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIpString) .ip(targetIpString)
.clientId(new String(clientId)) .clientId(new String(clientId))
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_CLIENT) .channelProxyType(ChannelProxyType.CLIENT_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(data.length) .flow(data.length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -3,17 +3,15 @@ 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.adapter.ChannelFlowAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelProxyFlowAdapter; import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelProxyFlowAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext; 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.NettyProxyMsg;
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.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.ServerChannelFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role; import org.springframework.context.annotation.Role;
@ -69,8 +67,8 @@ public class ServerHandleHttpReportClientProxyClientTransferResponseTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_CLIENT) .channelProxyType(ChannelProxyType.CLIENT_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(responseProxyMsg.getData().length) .flow(responseProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -10,8 +10,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.HandleChannelT
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext; import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyServerTransferRequestTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyServerTransferRequestTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.http.NettyHttpClientProxyServerTransfer; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.http.NettyHttpClientProxyServerTransfer;
@ -88,8 +88,8 @@ public class ServerHandleHttpReportClientProxyServerTransferRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIpString) .ip(targetIpString)
.clientId(clientIdString) .clientId(clientIdString)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_SEVER) .channelProxyType(ChannelProxyType.CLIENT_PROXY_SEVER)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(data.length) .flow(data.length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyP
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyServerTransferResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyServerTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
@ -67,8 +67,8 @@ public class ServerHandleHttpReportClientProxyServerTransferResponseTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_SEVER) .channelProxyType(ChannelProxyType.CLIENT_PROXY_SEVER)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(data.length) .flow(data.length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -11,8 +11,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyC
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportServerProxyClientTransferChannelInitSuccessfulTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
@ -88,8 +88,8 @@ public class ServerHandleHttpReportServerProxyClientTransferRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIpString) .ip(targetIpString)
.clientId(new String(clientId)) .clientId(new String(clientId))
.channelProxyTypeEnum(ChannelProxyTypeEnum.SERVER_PROXY_CLIENT) .channelProxyType(ChannelProxyType.SERVER_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(nettyByteBufData.getData().length) .flow(nettyByteBufData.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyP
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext; import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportServerProxyClientTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinition;
@ -62,8 +62,8 @@ public class ServerHandleHttpReportServerProxyClientTransferResponseTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId(targetClientId) .clientId(targetClientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.SERVER_PROXY_CLIENT) .channelProxyType(ChannelProxyType.SERVER_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.HTTP) .channelProtocolType(ChannelProtocolType.HTTP)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyP
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyClientTransferRequestTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyClientTransferRequestTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -64,8 +64,8 @@ public class ServerHandleSocksReportClientProxyClientTransferRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_CLIENT) .channelProxyType(ChannelProxyType.CLIENT_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(transferChannel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(transferChannel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyP
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyClientTransferResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyClientTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -63,8 +63,8 @@ public class ServerHandleSocksReportClientProxyClientTransferResponseTypeAdvance
.ip(targetIp) .ip(targetIp)
.port(targetPort) .port(targetPort)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_CLIENT) .channelProxyType(ChannelProxyType.CLIENT_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyC
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg; import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyServerTransferRequestTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyServerTransferRequestTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -62,8 +62,8 @@ public class ServerHandleSocksReportClientProxyServerTransferRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_SEVER) .channelProxyType(ChannelProxyType.CLIENT_PROXY_SEVER)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(transferChannel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(transferChannel, serverChannelFlow);

View File

@ -7,12 +7,11 @@ import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelProxyFlowAdapter; import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelProxyFlowAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext; 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.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.http.server.AbstractHandleHttpReportClientProxyServerTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyServerTransferResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportClientProxyServerTransferResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -65,8 +64,8 @@ public class ServerHandleSocksReportClientProxyServerTransferResponseTypeAdvance
.ip(targetIp) .ip(targetIp)
.port(targetPort) .port(targetPort)
.clientId(clientId) .clientId(clientId)
.channelProxyTypeEnum(ChannelProxyTypeEnum.CLIENT_PROXY_SEVER) .channelProxyType(ChannelProxyType.CLIENT_PROXY_SEVER)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow);

View File

@ -10,8 +10,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyP
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportServerProxyClientRequestTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportServerProxyClientRequestTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType; import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -63,8 +63,8 @@ public class ServerHandleSocksReportServerProxyClientRequestTypeAdvanced
.port(targetPort) .port(targetPort)
.ip(targetIp) .ip(targetIp)
.clientId("SERVER") .clientId("SERVER")
.channelProxyTypeEnum(ChannelProxyTypeEnum.SERVER_PROXY_CLIENT) .channelProxyType(ChannelProxyType.SERVER_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(channel, serverChannelFlow);

View File

@ -9,8 +9,8 @@ import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyC
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg; import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportServerProxyClientResponseTypeAdvanced; import org.framework.lazy.cloud.network.heartbeat.common.advanced.proxy.socks.server.AbstractHandleSocksReportServerProxyClientResponseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyFlowTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyTypeEnum; import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils; import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow; import org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy.ServerChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler; import org.framework.lazy.cloud.network.heartbeat.server.netty.proxy.socks.handler.NettySocksClientProxyServerRealHandler;
@ -60,8 +60,8 @@ public class ServerHandleSocksReportServerProxyClientResponseTypeAdvanced
.ip(targetIp) .ip(targetIp)
.port(targetPort) .port(targetPort)
.clientId("SERVER") .clientId("SERVER")
.channelProxyTypeEnum(ChannelProxyTypeEnum.SERVER_PROXY_CLIENT) .channelProxyType(ChannelProxyType.SERVER_PROXY_CLIENT)
.channelProxyFlowTypeEnum(ChannelProxyFlowTypeEnum.SOCKS) .channelProtocolType(ChannelProtocolType.SOCKS)
.flow(nettyProxyMsg.getData().length) .flow(nettyProxyMsg.getData().length)
.build(); .build();
channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow); channelProxyFlowAdapter.asyncHandler(nextChannel, serverChannelFlow);