73 Commits

Author SHA1 Message Date
wujiawei
d2086d5706 [update] 1.3.2-JDK24 2025-07-21 22:06:37 +08:00
wujiawei
faef62da51 [update] 1.3.2-JDK24 2025-07-21 17:02:30 +08:00
wujiawei
759e76dc72 Merge branch 'master' into 1.3.2-JDK24
# Conflicts:
#	ClientPermeateClient.md
#	README.md
#	client-k8s.yaml
#	install.md
#	pom.xml
#	version.md
#	wu-lazy-cloud-heartbeat-client/pom.xml
#	wu-lazy-cloud-heartbeat-common/pom.xml
#	wu-lazy-cloud-heartbeat-dns/pom.xml
#	wu-lazy-cloud-heartbeat-protocol-proxy/pom.xml
#	wu-lazy-cloud-heartbeat-server-cluster/pom.xml
#	wu-lazy-cloud-heartbeat-server/pom.xml
#	wu-lazy-cloud-heartbeat-start/pom.xml
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start/README.md
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start/pom.xml
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-cluster-start/pom.xml
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/README.md
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/k8s.yaml
#	wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start/pom.xml
2025-07-21 17:00:53 +08:00
wujiawei
ff3681fc46 [update] 1.3.1-JDK24 2025-07-21 16:59:53 +08:00
wujiawei
9e1a47f4e9 [update] 1.3.1-JDK24 2025-07-19 22:57:56 +08:00
wujiawei
b44cc66ce3 Merge branch 'refs/heads/master' into 1.3.2-JDK24 2025-07-17 20:08:18 +08:00
wujiawei
13858a0b7c [add] 修改中央仓库https://central.sonatype.com/account 2025-07-17 19:25:36 +08:00
wujiawei
2bac05ec77 Merge branch 'refs/heads/master' into 1.3.2-JDK24 2025-07-17 00:06:49 +08:00
wujiawei
caff71be87 [add] 修改中央仓库https://central.sonatype.com/account 2025-07-17 00:06:24 +08:00
wujiawei
28f6146615 Merge branch 'refs/heads/master' into 1.3.2-JDK24 2025-07-16 23:55:48 +08:00
wujiawei
04c683cb9a [add] 修改中央仓库https://central.sonatype.com/account 2025-07-16 23:49:03 +08:00
wujiawei
5083cd0d56 【fix】1.3.2-JDK24 2025-07-16 22:55:21 +08:00
wujiawei
e5f53b520b 【fix】授权调整 2025-07-16 21:49:01 +08:00
wujiawei
50b2b1866c 【fix】授权调整 2025-07-16 21:30:09 +08:00
wujiawei
841c24a6ed 【fix】注释udp、通道关闭验证通道关联通道是否存在 2025-07-15 16:20:06 +08:00
wujiawei
e387a43437 【fix】ui 调整 2025-07-15 15:17:19 +08:00
wujiawei
438198bcc5 【fix】ui 调整 2025-07-15 15:16:07 +08:00
wujiawei
afe1a1417f 【fix】ui 调整 2025-07-15 13:24:36 +08:00
wujiawei
d9d82a99d5 【fix】ui 调整 2025-07-15 13:23:53 +08:00
wujiawei
c5aeb6f0f7 【fix】proxy代理支持令牌验证 2025-07-14 18:54:10 +08:00
wujiawei
f8f485a14a 【fix】本地代理支持代理日志记录 2025-07-13 14:52:18 +08:00
wujiawei
7178974abb 【fix】 本地socket代理通道添加属性。目标ip、目标端口、访客ID 2025-07-12 12:07:40 +08:00
wujiawei
f2fede4a96 【fix】 添加版本记录 2025-07-09 22:15:54 +08:00
wujiawei
74eab26478 [add] 修改inethost字段长度 2025-07-01 20:28:44 +08:00
wujiawei
faabae3d19 [add] 添加socks授权验证 2025-06-26 21:00:20 +08:00
wujiawei
6c86a41359 [fix] 使用自定义@LazyMapper 进行数据转换 2025-06-25 11:08:52 +08:00
wujiawei
3353e4bd83 【fix】 添加版本记录 2025-06-23 13:16:10 +08:00
wujiawei
2f0f4270d3 【fix】 添加版本记录 2025-06-23 13:11:23 +08:00
wujiawei
61f639c51d [fix] registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-framework-parent:jdk-24-x64 2025-06-19 20:09:21 +08:00
wujiawei
46e657535b [fix] add docker hub image version 2025-06-19 19:59:19 +08:00
wujiawei
ea296da78e [fix] 1.3.1-JDK24-SNAPSHOT 2025-06-19 19:33:31 +08:00
wujiawei
aafa684525 [fix] 使用自定义@LazyMapper 进行数据转换 2025-06-19 16:25:37 +08:00
wujiawei
e41c293c31 [fix] 使用自定义@LazyMapper 进行数据转换 2025-06-18 16:51:08 +08:00
wujiawei
c8b4238d90 [fix] 1.3.1-JDK24-SNAPSHOT 2025-06-18 13:33:43 +08:00
wujiawei
32eaace9c1 [fix] 异常打印 2025-06-17 13:51:42 +08:00
wujiawei
21136284c7 [fix] 优化绑定下一个通道问题 2025-06-17 13:50:37 +08:00
wujiawei
7c640816aa [fix] 优化页面展示 2025-06-17 10:14:55 +08:00
wujiawei
aba3e2acc9 [fix] 优化端口映射问题 2025-06-17 09:27:03 +08:00
wujiawei
25f81ca271 [fix] 代理流量使用队列 2025-06-16 17:11:38 +08:00
wujiawei
a1f764f1cc [fix] 客户端路由,客户端ID及路由IP为唯一行索引 2025-06-16 16:14:52 +08:00
wujiawei
1699130f14 [fix] 代码格式化 2025-06-16 13:48:35 +08:00
wujiawei
6b16ff7065 [fix] 修改native无法正常打包问题 2025-06-16 13:27:29 +08:00
wujiawei
87435b85d4 [add] 删除namespace规则 2025-06-16 08:45:54 +08:00
wujiawei
2fc0187f43 [add] 删除namespace规则 2025-06-16 08:44:48 +08:00
wujiawei
513c8ba095 [add] 删除namespace规则 2025-06-16 00:34:06 +08:00
wujiawei
2add2ddfa7 [add] 删除namespace规则 2025-06-15 22:06:58 +08:00
wujiawei
f791b36d24 [add] 服务端渗透客户端优化 2025-06-15 18:16:41 +08:00
wujiawei
bebb67395e [add] 服务端渗透客户端优化 2025-06-15 18:08:19 +08:00
wujiawei
ad1c5b1b36 [add] 服务端渗透客户端优化 2025-06-15 18:04:11 +08:00
wujiawei
4c76635292 [add] 服务端渗透服务端 2025-06-15 17:22:25 +08:00
wujiawei
ffdd593113 [add] 客户端渗透优化 2025-06-15 16:11:17 +08:00
wujiawei
5616abafd0 [add] 客户端下线异常问题 2025-06-15 01:49:38 +08:00
wujiawei
6d0bcd2f63 [add] 客户端下线异常问题 2025-06-15 00:50:16 +08:00
wujiawei
da7d55c266 [add] 调试namespace 2025-06-14 20:03:16 +08:00
wujiawei
30403d1da8 [add] 添加namespace管理 2025-06-14 19:28:16 +08:00
wujiawei
58026465ad [add] 添加namespace管理 2025-06-14 19:02:13 +08:00
wujiawei
3b7bf3d983 [add] 添加namespace管理 2025-06-14 19:02:07 +08:00
wujiawei
7838f7a88d [fix] 修改native无法正常打包问题 2025-06-13 16:20:05 +08:00
wujiawei
9c13074e5c [fix] 客户端存储服务器信息namespace 字段设置非空 2025-06-13 16:10:15 +08:00
wujiawei
08c0194733 [fix] 客户端存储服务器信息namespace 字段设置非空 2025-06-13 12:24:47 +08:00
wujiawei
e3deb4cdfe [fix] 客户端存储服务器信息namespace 字段设置非空 2025-06-12 12:38:35 +08:00
wujiawei
229e273b7d [fix] 添加namespace 2025-06-11 16:45:17 +08:00
wujiawei
3163987ef7 [fix] 添加namespace 2025-06-11 16:19:11 +08:00
wujiawei
51b603a6c5 [fix] 添加服务端ID 2025-06-11 10:09:28 +08:00
wujiawei
c34f1239d8 [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-10 09:26:40 +08:00
wujiawei
edaa4b84d7 Revert "[fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝"
This reverts commit 6c6584fdb9.
2025-06-10 09:26:16 +08:00
wujiawei
6c6584fdb9 [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-09 16:41:24 +08:00
wujiawei
221623e9c0 [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-09 16:23:25 +08:00
wujiawei
ff150eb31c [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-09 16:19:55 +08:00
wujiawei
e1de673b52 [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-09 14:56:45 +08:00
wujiawei
01a2937414 [fix] 修复native打包与mapper不兼容问题,切换至自定义bean拷贝 2025-06-09 14:40:06 +08:00
wujiawei
e8383c78ad [fix] 添加代理流量监控 2025-06-07 11:13:34 +08:00
wujiawei
1a08fe64e9 [fix] 修改唯一索引问题 2025-06-07 01:31:43 +08:00
878 changed files with 7544 additions and 9176 deletions

View File

@@ -7,19 +7,19 @@
#### 操作步骤拥有公网ip的服务器开发6001web、7001端口tcp然后执行命令启动服务端
```shell
docker run -d -it -p 6001:6001 -p 7001:7001 -e spring.profiles.active=prod -e MAIN_DB_HOST=localhost:3306 -e MAIN_DB_PASSWORD=root -e MAIN_DB_PASSWORD=root --name wu-lazy-cloud-heartbeat-server-start registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.3.1-JDK17-SNAPSHOT
docker run -d -it -p 6001:6001 -p 7001:7001 -e spring.profiles.active=prod -e MAIN_DB_HOST=localhost:3306 -e MAIN_DB_PASSWORD=root -e MAIN_DB_PASSWORD=root --name wu-lazy-cloud-heartbeat-server-start registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.3.1-JDK24
```
#### 操作步骤:杭州本地机房所在网络服务器启动客户端、你老家所在网络中启动客户端,命令如下
```shell
docker run -d -it --privileged --name hangzhou-client --restart=always -e spring.lazy.netty.client.inet-host=公网IP -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="hangzhou-jifang" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT
docker run -d -it --privileged --name hangzhou-client --restart=always -e spring.lazy.netty.client.inet-host=公网IP -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="hangzhou-jifang" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK24
```
```shell
docker run -d -it --privileged --name my-home-client --restart=always -e spring.lazy.netty.client.inet-host=公网IP -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="my-home" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT
docker run -d -it --privileged --name my-home-client --restart=always -e spring.lazy.netty.client.inet-host=公网IP -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="my-home" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK24
```
#### 操作步骤:配置端口
![client_permeate_port_pool.png](client_permeate_port_pool.png)
#### 操作步骤:打开页面配置菜单看到如下界面(from客户端ID你老家网络中的电脑to客户端ID
#### 操作步骤:打开页面配置菜单看到如下界面(客户端ID你老家网络中的电脑目标客户端ID
![client_permeate_client_mapping.png](client_permeate_client_mapping.png)
#### 连接使用在你老家使用my-home这个客户端所在机器上的ip+13306 即可访问杭州机房内的数据库的服务3306

View File

@@ -14,6 +14,9 @@
<a target="_blank" href="https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html">
<img src="https://img.shields.io/badge/JDK-17-green.svg" alt="jdk-17" />
</a>
<a target="_blank" href="https://www.oracle.com/java/technologies/javase/jdk24-archive-downloads.html">
<img src="https://img.shields.io/badge/JDK-24-green.svg" alt="jdk-24" />
</a>
<br />
<img src="https://img.shields.io/badge/SpringBoot-v3.x-blue">
<br />
@@ -33,7 +36,7 @@
wu-lazy-cloud-network
是一款基于([wu-framework-parent](https://gitee.com/wujiawei1207537021/wu-framework-parent)孵化出的项目内部使用Lazy
ORM操作数据库使用环境JDK17 Spring Boot 3.0.2。的网络穿透、渗透工具支持Tcp、Http、Socks
ORM操作数据库使用环境JDK24 Spring Boot 3.5.0。的网络穿透、渗透工具支持Tcp、Http、Socks
主要功能:
- 服务端渗透客户端网络穿透对于没有公网IP的服务进行公网IP映射
- ![NetworkPermeateServerPermeateClient.png](NetworkPermeateServerPermeateClient.png)
@@ -88,21 +91,21 @@ ORM操作数据库使用环境JDK17 Spring Boot 3.0.2。的网络穿透、渗
| 模块 | 版本 | 描述 |
|------------------------------------------------------------------------------------------------------------|----------------------|------------------------------|
| [wu-lazy-cloud-heartbeat-common](wu-lazy-cloud-heartbeat-common) | 1.3.1-JDK17-SNAPSHOT | 内网穿透公共模块(声明接口、枚举、常量、适配器、解析器) |
| [wu-lazy-cloud-heartbeat-client](wu-lazy-cloud-heartbeat-client) | 1.3.1-JDK17-SNAPSHOT | 客户端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-server](wu-lazy-cloud-heartbeat-server) | 1.3.1-JDK17-SNAPSHOT | 服务端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-client-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start) | 1.3.1-JDK17-SNAPSHOT | 客户端样例 |
| [wu-lazy-cloud-heartbeat-server-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start) | 1.3.1-JDK17-SNAPSHOT | 服务端样例 |
| [wu-lazy-cloud-heartbeat-common](wu-lazy-cloud-heartbeat-common) | 1.3.1-JDK24 | 内网穿透公共模块(声明接口、枚举、常量、适配器、解析器) |
| [wu-lazy-cloud-heartbeat-client](wu-lazy-cloud-heartbeat-client) | 1.3.1-JDK24 | 客户端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-server](wu-lazy-cloud-heartbeat-server) | 1.3.1-JDK24 | 服务端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-client-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start) | 1.3.1-JDK24 | 客户端样例 |
| [wu-lazy-cloud-heartbeat-server-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start) | 1.3.1-JDK24 | 服务端样例 |
### 使用技术
| 框架 | 版本 | 描述 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|--------------|
| spring-boot | 3.0.7 | springboot框架 |
| [wu-framework-web](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-framework-web) | 1.3.1-JDK17-SNAPSHOT | web容器 |
| [Lazy -ORM](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-inner-intergration/wu-database-parent) | 1.3.1-JDK17-SNAPSHOT | ORM |
| [wu-framework-web](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-framework-web) | 1.3.1-JDK24 | web容器 |
| [Lazy -ORM](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-inner-intergration/wu-database-parent) | 1.3.1-JDK24 | ORM |
| mysql-connector-j | 8.0.33 | mysql驱动 |
| [wu-authorization-server-platform-starter](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-smart-platform/wu-authorization-server-platform-starter) | 1.3.1-JDK17-SNAPSHOT | 用户授权体系 |
| [wu-authorization-server-platform-starter](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-smart-platform/wu-authorization-server-platform-starter) | 1.3.1-JDK24 | 用户授权体系 |
### 使用环境
@@ -115,7 +118,7 @@ ORM操作数据库使用环境JDK17 Spring Boot 3.0.2。的网络穿透、渗
docker启动
docker run -d -it -p 18080:18080 --name wu-lazy-cloud-heartbeat-server registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server:1.3.1-JDK17-SNAPSHOT
docker run -d -it -p 18080:18080 --name wu-lazy-cloud-heartbeat-server registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server:1.3.1-JDK24
http://127.0.0.1:18080/swagger-ui/index.html
@@ -183,4 +186,7 @@ ORM操作数据库使用环境JDK17 Spring Boot 3.0.2。的网络穿透、渗
![server_route.png](server_route.png)
- 服务端虚拟路由管理
- 创建一个虚拟的不存在的IP代理到指定的IP
![server_virtual_route.png](server_virtual_route.png)
![server_virtual_route.png](server_virtual_route.png)
-
- 代理流量管理
![client_proxy_flow_manager.png](client_proxy_flow_manager.png)

View File

@@ -28,7 +28,7 @@ spec:
containers:
- name: wu-lazy-cloud-heartbeat-local-client-start
image: >-
registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT
registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK24
env:
- name: spring.lazy.netty.client.inet-host
value: 124.222.48.62

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@@ -9,7 +9,7 @@
```shell
docker run -d -it -p 6001:6001 -p 7001:7001 -p 8001:8001 -p 9001:9001 --name wlcn-s registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server:1.3.1-JDK17-SNAPSHOT
docker run -d -it -p 6001:6001 -p 7001:7001 -p 8001:8001 -p 9001:9001 --name wlcn-s registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server:1.3.1-JDK24
```
##### 启动客户端
@@ -24,5 +24,5 @@ docker run -d -it -p 6001:6001 -p 7001:7001 -p 8001:8001 -p 9001:9001 --nam
- 打开浏览器访问界面 http://127.0.0.1:6004/netty-client-local-ui/index.html
```shell
docker run -d -it --privileged -p 6004:6004 --name wlcn-c --restart=always -e spring.lazy.netty.client.inet-host=192.168.xx.xx -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="wlcn-c" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT
docker run -d -it --privileged -p 6004:6004 --name wlcn-c --restart=always -e spring.lazy.netty.client.inet-host=192.168.xx.xx -e spring.lazy.netty.client.inet-port=7001 -e spring.lazy.netty.client.client-id="wlcn-c" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK24
```

225
pom.xml
View File

@@ -8,14 +8,33 @@
<parent>
<artifactId>wu-framework-parent</artifactId>
<groupId>top.wu2020</groupId>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>1.3.2-JDK24</version>
</parent>
<artifactId>wu-lazy-cloud-network</artifactId>
<packaging>pom</packaging>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>1.3.2-JDK24</version>
<description>云上云下</description>
<name>wlcn项目</name>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
<!-->开发者的信息<-->
<developers>
<developer>
<name>Jia Wei Wu</name>
<email>1207537021@qq.com</email>
</developer>
</developers>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<!-->项目的版本管理地址<-->
<scm>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
</scm>
<modules>
<!-- 云上服务组件 -->
@@ -38,7 +57,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<version>1.18.38</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -58,12 +77,14 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>3.5.3</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>${spring-boot-starter.version}</version>
</dependency>
</dependencies>
@@ -72,7 +93,7 @@
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-framework-dependencies</artifactId>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>1.3.2-JDK24</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -80,200 +101,6 @@
</dependencyManagement>
<profiles>
<profile>
<id>oss</id>
<build>
<plugins>
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<locale>en_US</locale>
<encoding>UTF-8</encoding>
<charset>UTF-8</charset>
<doclint>none</doclint>
</configuration>
</execution>
</executions>
</plugin>
<!-- GPG -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- flatten -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-->发布的地址<-->
<distributionManagement>
<snapshotRepository>
<id>oss-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>oss-snapshots</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>native</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Spring-Boot-Native-Processed>true</Spring-Boot-Native-Processed>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-tiny:latest</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
</env>
</image>
</configuration>
<executions>
<execution>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
<requiredVersion>22.3</requiredVersion>
</configuration>
<executions>
<execution>
<id>add-reachability-metadata</id>
<goals>
<goal>add-reachability-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>nativeTest</id>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>process-test-aot</id>
<goals>
<goal>process-test-aot</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
<requiredVersion>22.3</requiredVersion>
</configuration>
<executions>
<execution>
<id>native-test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -36,4 +36,12 @@
[add] 新增客户端路由管理、新增服务端路由管理
[add] 支持新增虚拟IP代理到指定的IP
[add] 通过页面配置,代理支持控制端口代理控制
#### 1.3.1-JDK17
[add] 新增代理流量监控
[add] docker仓库上架dockerhub搜索https://hub.docker.com/search?q=wlcn
#### 1.3.1-JDK24
[add] 新增代理流量监控
[add] 升级使用jdk24、springboot 3.5.0
[add] 添加socks授权验证
#### 下一版本计划

View File

@@ -5,16 +5,36 @@
<parent>
<groupId>top.wu2020</groupId>
<artifactId>wu-lazy-cloud-network</artifactId>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>1.3.2-JDK24</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wu-lazy-cloud-heartbeat-client</artifactId>
<description>云下心跳客户端</description>
<name>wlcn客户端模块</name>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
<!-->开发者的信息<-->
<developers>
<developer>
<name>Jia Wei Wu</name>
<email>1207537021@qq.com</email>
</developer>
</developers>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<!-->项目的版本管理地址<-->
<scm>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
</scm>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>24</maven.compiler.source>
<maven.compiler.target>24</maven.compiler.target>
</properties>
<dependencies>
@@ -22,11 +42,12 @@
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-lazy-cloud-heartbeat-common</artifactId>
<version>${wu-lazy-cloud-heartbeat-common.version}</version>
</dependency>
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-lazy-cloud-heartbeat-protocol-proxy</artifactId>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>${wu-lazy-cloud-heartbeat-protocol-proxy.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
@@ -38,14 +59,17 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.3.232</version>
</dependency>
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-framework-web-spring-starter</artifactId>
<version>${wu-framework-web-spring-starter.version}</version>
</dependency>
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-database-lazy-orm-plus-starter</artifactId>
<version>${wu-database-lazy-orm-plus-starter.version}</version>
</dependency>
</dependencies>

View File

@@ -7,87 +7,86 @@ import org.framework.lazy.cloud.network.heartbeat.client.application.command.laz
import org.framework.lazy.cloud.network.heartbeat.client.application.command.lazy.netty.server.properties.LazyNettyServerPropertiesQueryListCommand;
import org.framework.lazy.cloud.network.heartbeat.client.application.command.lazy.netty.server.properties.LazyNettyServerPropertiesQueryOneCommand;
import org.framework.lazy.cloud.network.heartbeat.client.application.dto.LazyNettyServerPropertiesDTO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
import org.wu.framework.core.mapper.LazyStructMappers;
import org.wu.framework.core.mapper.LazyStructMapper;
/**
* describe 服务端配置信息
* describe 服务端配置信息
*
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyAssembler
**/
@Mapper
@LazyStructMapper
public interface LazyNettyServerPropertiesDTOAssembler {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerPropertiesDTOAssembler INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesDTOAssembler.class);
LazyNettyServerPropertiesDTOAssembler INSTANCE = LazyStructMappers.getMapper(LazyNettyServerPropertiesDTOAssembler.class);
// LazyNettyServerPropertiesDTOAssembler INSTANCE = new LazyNettyServerPropertiesDTOAssemblerImpl();
/**
* describe 应用层存储入参转换成 领域对象
*
* @param lazyNettyServerPropertiesStoryCommand 保存服务端配置信息对象
* @param lazyNettyServerPropertiesStoryCommand 保存服务端配置信息对象
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesStoryCommand lazyNettyServerPropertiesStoryCommand);
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesStoryCommand lazyNettyServerPropertiesStoryCommand);
/**
* describe 应用层更新入参转换成 领域对象
*
* @param lazyNettyServerPropertiesUpdateCommand 更新服务端配置信息对象
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @param lazyNettyServerPropertiesUpdateCommand 更新服务端配置信息对象
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesUpdateCommand lazyNettyServerPropertiesUpdateCommand);
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesUpdateCommand lazyNettyServerPropertiesUpdateCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyServerPropertiesQueryOneCommand 查询单个服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @param lazyNettyServerPropertiesQueryOneCommand 查询单个服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryOneCommand lazyNettyServerPropertiesQueryOneCommand);
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryOneCommand lazyNettyServerPropertiesQueryOneCommand);
/**
* describe 应用层查询入参转换成 领域对象
*
* @param lazyNettyServerPropertiesQueryListCommand 查询集合服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @param lazyNettyServerPropertiesQueryListCommand 查询集合服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryListCommand lazyNettyServerPropertiesQueryListCommand);
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesQueryListCommand lazyNettyServerPropertiesQueryListCommand);
/**
* describe 应用层删除入参转换成 领域对象
*
* @param lazyNettyServerPropertiesRemoveCommand 删除服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @param lazyNettyServerPropertiesRemoveCommand 删除服务端配置信息对象参数
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesRemoveCommand lazyNettyServerPropertiesRemoveCommand);
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesRemoveCommand lazyNettyServerPropertiesRemoveCommand);
/**
* describe 持久层领域对象转换成DTO对象
*
* @param lazyNettyServerProperties 服务端配置信息领域对象
* @return {@link LazyNettyServerPropertiesDTO} 服务端配置信息DTO对象
* @param lazyNettyServerProperties 服务端配置信息领域对象
* @return {@link LazyNettyServerPropertiesDTO} 服务端配置信息DTO对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerPropertiesDTO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties);
LazyNettyServerPropertiesDTO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties);
}

View File

@@ -1,14 +1,12 @@
package org.framework.lazy.cloud.network.heartbeat.client.application.command.lazy.netty.server.properties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Integer;
/**
* describe 服务端配置信息
*
@@ -21,7 +19,6 @@ import java.lang.Integer;
@Schema(title = "lazy_netty_server_properties_query_List_command",description = "服务端配置信息")
public class LazyNettyServerPropertiesQueryListCommand {
/**
*
* 客户身份ID

View File

@@ -5,6 +5,7 @@ import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.wu.framework.core.NormalUsedString;
import java.lang.String;
import java.time.LocalDateTime;
@@ -22,6 +23,7 @@ import java.lang.Integer;
public class LazyNettyServerPropertiesQueryOneCommand {
/**
*
* 客户身份ID

View File

@@ -5,6 +5,7 @@ import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.wu.framework.core.NormalUsedString;
import java.lang.String;
import java.time.LocalDateTime;
@@ -22,6 +23,7 @@ import java.lang.Integer;
public class LazyNettyServerPropertiesRemoveCommand {
/**
*
* 客户身份ID

View File

@@ -5,6 +5,7 @@ import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.wu.framework.core.NormalUsedString;
import java.lang.String;
import java.time.LocalDateTime;
@@ -22,6 +23,7 @@ import java.lang.Integer;
public class LazyNettyServerPropertiesStoryCommand {
/**
*
* 客户身份ID

View File

@@ -5,6 +5,7 @@ import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.wu.framework.core.NormalUsedString;
import java.lang.String;
import java.time.LocalDateTime;
@@ -22,6 +23,7 @@ import java.lang.Integer;
public class LazyNettyServerPropertiesUpdateCommand {
/**
*
* 客户身份ID

View File

@@ -1,14 +1,12 @@
package org.framework.lazy.cloud.network.heartbeat.client.application.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Integer;
/**
* describe 服务端配置信息
*
@@ -22,6 +20,7 @@ import java.lang.Integer;
public class LazyNettyServerPropertiesDTO {
/**
*
* 客户身份ID

View File

@@ -17,7 +17,6 @@ import org.framework.lazy.cloud.network.heartbeat.client.netty.permeate.udp.sock
import org.framework.lazy.cloud.network.heartbeat.common.advanced.HandleChannelTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProtocolType;
import org.wu.framework.core.NormalUsedString;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.lazy.orm.web.plus.stereotype.LazyApplication;
import org.wu.framework.web.response.Result;
@@ -142,7 +141,7 @@ public class LazyNettyServerPropertiesApplicationImpl implements LazyNettyServer
@Override
public Result<List<LazyNettyServerPropertiesDTO>> findList(LazyNettyServerPropertiesQueryListCommand lazyNettyServerPropertiesQueryListCommand) {
LazyNettyServerProperties lazyNettyServerProperties = LazyNettyServerPropertiesDTOAssembler.INSTANCE.toLazyNettyServerProperties(lazyNettyServerPropertiesQueryListCommand);
return lazyNettyServerPropertiesRepository.findList(lazyNettyServerProperties).convert(lazyNettyServerPropertiess -> lazyNettyServerPropertiess.stream().map(LazyNettyServerPropertiesDTOAssembler.INSTANCE::fromLazyNettyServerProperties).collect(Collectors.toList()));
return lazyNettyServerPropertiesRepository.findList(lazyNettyServerProperties).convert(lazyNettyServerPropertiesList -> lazyNettyServerPropertiesList.stream().map(LazyNettyServerPropertiesDTOAssembler.INSTANCE::fromLazyNettyServerProperties).collect(Collectors.toList()));
}
/**
@@ -196,12 +195,12 @@ public class LazyNettyServerPropertiesApplicationImpl implements LazyNettyServer
if (ProtocolType.TCP.equals(protocolType)) {
nettyClientSocket = new
NettyTcpClientSocket(inetHost, inetPort, clientId,
NormalUsedString.DEFAULT, appKey, appSecret,
appKey, appSecret,
clientChangeEvent, handleChannelTypeAdvancedList);
} else if (ProtocolType.UDP.equals(protocolType)) {
nettyClientSocket = new
NettyUdpClientSocket(inetHost, inetPort, clientId,
NormalUsedString.DEFAULT, appKey, appSecret,
appKey, appSecret,
clientChangeEvent, handleChannelTypeAdvancedList);
} else {
nettyClientSocket = null;

View File

@@ -4,6 +4,7 @@ import lombok.Data;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProtocolType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.wu.framework.core.NormalUsedString;
/**
* netty 客户服务端地址配置属性
@@ -13,6 +14,7 @@ import org.springframework.context.annotation.Configuration;
@Data
public class NettyClientProperties {
public static final String PREFIX = "spring.lazy.netty.client";
/**
* 服务端地址 如127.0.0.1
*/

View File

@@ -7,6 +7,8 @@ import org.framework.lazy.cloud.network.heartbeat.client.config.NettyClientPrope
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity.LazyNettyServerPropertiesDO;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProtocolType;
import org.framework.lazy.cloud.network.heartbeat.protocol.token.AuthenticationToken;
import org.framework.lazy.cloud.network.heartbeat.protocol.token.AuthenticationTokenContext;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
@@ -26,7 +28,9 @@ public class NettyClientSocketApplicationListener implements ApplicationListener
private final LazyNettyServerPropertiesApplication lazyNettyServerPropertiesApplication;
public NettyClientSocketApplicationListener(NettyClientProperties nettyClientProperties, LazyLambdaStream lazyLambdaStream, LazyNettyServerPropertiesApplication lazyNettyServerPropertiesApplication) {
public NettyClientSocketApplicationListener(NettyClientProperties nettyClientProperties,
LazyLambdaStream lazyLambdaStream,
LazyNettyServerPropertiesApplication lazyNettyServerPropertiesApplication) {
this.nettyClientProperties = nettyClientProperties;
this.lazyLambdaStream = lazyLambdaStream;
this.lazyNettyServerPropertiesApplication = lazyNettyServerPropertiesApplication;
@@ -49,7 +53,9 @@ public class NettyClientSocketApplicationListener implements ApplicationListener
log.warn("配置信息为空,请通过页面添加配置信息:{}", nettyClientProperties);
return;
}
LazyNettyServerPropertiesDO lazyNettyServerPropertiesDO = new LazyNettyServerPropertiesDO();
lazyNettyServerPropertiesDO.setClientId(clientId);
lazyNettyServerPropertiesDO.setInetHost(inetHost);
lazyNettyServerPropertiesDO.setInetPort(inetPort);
@@ -70,6 +76,12 @@ public class NettyClientSocketApplicationListener implements ApplicationListener
if (!exists) {
lazyLambdaStream.insert(lazyNettyServerPropertiesDO);
}
// 添加本地token
AuthenticationToken authenticationToken = new AuthenticationToken();
authenticationToken.setUsedByClientId(clientId);
authenticationToken.setAppKey(appKey);
authenticationToken.setAppSecret(appSecret);
AuthenticationTokenContext.setAuthenticationToken(clientId, appKey, appSecret);
}catch (Exception e){
e.printStackTrace();
}

View File

@@ -6,6 +6,7 @@ import lombok.experimental.Accessors;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProtocolType;
import org.wu.framework.core.NormalUsedString;
import java.time.LocalDateTime;
/**
@@ -21,6 +22,7 @@ import java.time.LocalDateTime;
public class LazyNettyServerProperties {
/**
*
* 客户身份ID

View File

@@ -2,47 +2,46 @@ package org.framework.lazy.cloud.network.heartbeat.client.infrastructure.convert
import org.framework.lazy.cloud.network.heartbeat.client.domain.model.lazy.netty.server.properties.LazyNettyServerProperties;
import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity.LazyNettyServerPropertiesDO;
import org.mapstruct.factory.Mappers;
import org.mapstruct.Mapper;
import org.wu.framework.core.mapper.LazyStructMapper;
import org.wu.framework.core.mapper.LazyStructMappers;
/**
* describe 服务端配置信息
* describe 服务端配置信息
*
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
* @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureConverter
**/
@Mapper
@LazyStructMapper
public interface LazyNettyServerPropertiesConverter {
/**
* describe MapStruct 创建的代理对象
*
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerPropertiesConverter INSTANCE = Mappers.getMapper(LazyNettyServerPropertiesConverter.class);
LazyNettyServerPropertiesConverter INSTANCE = LazyStructMappers.getMapper(LazyNettyServerPropertiesConverter.class);
// LazyNettyServerPropertiesConverter INSTANCE = new LazyNettyServerPropertiesConverterImpl();
/**
* describe 实体对象 转换成领域对象
*
* @param lazyNettyServerPropertiesDO 服务端配置信息实体对象
* @param lazyNettyServerPropertiesDO 服务端配置信息实体对象
* @return {@link LazyNettyServerProperties} 服务端配置信息领域对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerProperties toLazyNettyServerProperties(LazyNettyServerPropertiesDO lazyNettyServerPropertiesDO);
/**
* describe 领域对象 转换成实体对象
*
* @param lazyNettyServerProperties 服务端配置信息领域对象
* @return {@link LazyNettyServerPropertiesDO} 服务端配置信息实体对象
* @param lazyNettyServerProperties 服务端配置信息领域对象
* @return {@link LazyNettyServerPropertiesDO} 服务端配置信息实体对象
* @author Jia wei Wu
* @date 2024/04/03 03:00 下午
**/
LazyNettyServerPropertiesDO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties);
LazyNettyServerPropertiesDO fromLazyNettyServerProperties(LazyNettyServerProperties lazyNettyServerProperties);
}

View File

@@ -6,6 +6,7 @@ import lombok.experimental.Accessors;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ProtocolType;
import org.wu.framework.core.NormalUsedString;
import org.wu.framework.lazy.orm.core.stereotype.LazyTable;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableFieldId;
@@ -26,6 +27,7 @@ import java.time.LocalDateTime;
public class LazyNettyServerPropertiesDO {
/**
*
* 主键ID
@@ -38,7 +40,7 @@ public class LazyNettyServerPropertiesDO {
* 客户身份ID
*/
@Schema(description ="客户身份ID",name ="clientId",example = "")
@LazyTableFieldUnique(name="client_id",comment="客户身份ID",columnType="varchar(255)")
@LazyTableFieldUnique(name="client_id",comment="客户身份ID",columnType="varchar(25)")
private String clientId;
/**

View File

@@ -1,22 +1,19 @@
package org.framework.lazy.cloud.network.heartbeat.client.infrastructure.persistence;
import jakarta.annotation.Resource;
import org.framework.lazy.cloud.network.heartbeat.client.domain.model.lazy.netty.server.properties.LazyNettyServerProperties;
import org.framework.lazy.cloud.network.heartbeat.client.domain.model.lazy.netty.server.properties.LazyNettyServerPropertiesRepository;
import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity.LazyNettyServerPropertiesDO;
import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.converter.LazyNettyServerPropertiesConverter;
import org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity.LazyNettyServerPropertiesDO;
import org.springframework.stereotype.Repository;
import java.util.stream.Collectors;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import org.wu.framework.lazy.orm.database.lambda.stream.lambda.LazyLambdaStream;
import org.wu.framework.lazy.orm.database.lambda.stream.wrapper.LazyWrappers;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import jakarta.annotation.Resource;
import org.wu.framework.lazy.orm.database.lambda.stream.lambda.LazyLambdaStream;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
import java.util.stream.Collectors;
/**
* describe 服务端配置信息

View File

@@ -13,14 +13,15 @@ import java.util.List;
@Data
public class NettyClientPermeateClientVisitor implements InternalNetworkPermeate {
/**
* 当前客户端ID
*/
private String fromClientId;
private String originClientId;
/**
* 目标客户端ID
*/
private String toClientId;
private String targetClientId;
/**
* 目标地址
*/

View File

@@ -13,12 +13,12 @@ public interface ClientChangeEvent {
/**
* 推送客户端在线
* @param clientId 客户端
* @param inetHost 服务端ip
* @param inetPort 服务端端口
* @param serverId 服务端ID
*
* @param inetHost 服务端ip
* @param inetPort 服务端端口
* @param clientId 客户端
*/
void clientOnLine(String inetHost, int inetPort,String serverId ,String clientId);
void clientOnLine(String inetHost, int inetPort,String clientId);
/**
* 推送客户端离线
@@ -30,10 +30,9 @@ public interface ClientChangeEvent {
*
* @param inetHost 服务端ip
* @param inetPort 服务端端口
* @param serverId 服务端ID
* @param clientId 客户端
*/
void clientOffLine(String inetHost, int inetPort,String serverId,String clientId);
void clientOffLine(String inetHost, int inetPort,String clientId);
/**
* 暂存开启

View File

@@ -51,11 +51,10 @@ public class DefaultClientChangeEventImpl implements ClientChangeEvent {
*
* @param inetHost 服务端ip
* @param inetPort 服务端端口
* @param serverId 服务端ID
* @param clientId 客户端
*/
@Override
public void clientOnLine(String inetHost, int inetPort, String serverId, String clientId) {
public void clientOnLine(String inetHost, int inetPort, String clientId) {
LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties();
lazyNettyServerProperties.setClientId(clientId);
lazyNettyServerProperties.setInetHost(inetHost);
@@ -92,11 +91,10 @@ public class DefaultClientChangeEventImpl implements ClientChangeEvent {
*
* @param inetHost 服务端ip
* @param inetPort 服务端端口
* @param serverId
* @param clientId 客户端
*/
@Override
public void clientOffLine(String inetHost, int inetPort, String serverId, String clientId) {
public void clientOffLine(String inetHost, int inetPort, String clientId) {
LazyNettyServerProperties lazyNettyServerProperties = new LazyNettyServerProperties();
lazyNettyServerProperties.setClientId(clientId);
lazyNettyServerProperties.setInetHost(inetHost);

View File

@@ -41,8 +41,8 @@ public class ClientHandleTcpChannelTransferTypeAdvancedHandleDistributeTcpDistri
log.debug("接收到服务端需要内网穿透的数据:{}" , nettyProxyMsg);
String clientId = nettyClientProperties.getClientId();
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
byte[] visitorId = nettyProxyMsg.getVisitorId();
// 真实服务通道
// Channel realChannel = NettyRealIdContext.getReal(new String(visitorId));

View File

@@ -31,8 +31,8 @@ public class ClientHandleTcpClientChannelActiveAdvanced extends AbstractHandleTc
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel channel = nettyChannelContext.channel();
// 缓存当前通道
byte[] clientIdByte = nettyProxyMsg.getClientId();
String clientId = new String(clientIdByte);
String clientId = nettyProxyMsg.clientId();
ChannelContext.push(channel, clientId);
ChannelAttributeKeyUtils.buildClientId(channel, clientId);
}

View File

@@ -24,7 +24,8 @@ import java.util.List;
*/
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j
public class ClientHandleTcpDistributeClientPermeateClientInitTypeAdvanced extends AbstractHandleTcpDistributeClientPermeateClientInitTypeAdvanced<NettyProxyMsg> {
public class ClientHandleTcpDistributeClientPermeateClientInitTypeAdvanced
extends AbstractHandleTcpDistributeClientPermeateClientInitTypeAdvanced<NettyProxyMsg> {
/**
* 处理当前数据
@@ -35,14 +36,14 @@ public class ClientHandleTcpDistributeClientPermeateClientInitTypeAdvanced exten
@Override
public void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
// 初始化 客户端渗透服务端socket
byte[] fromClientIdBytes = nettyProxyMsg.getClientId();
byte[] originClientIdBytes = nettyProxyMsg.getClientId();
byte[] visitorPortBytes = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIpBytes = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPortBytes = nettyProxyMsg.getClientTargetPort();
byte[] toClientIdBytes = nettyProxyMsg.getData();
byte[] clientTargetIpBytes = nettyProxyMsg.getTargetIp();
byte[] clientTargetPortBytes = nettyProxyMsg.getTargetPort();
byte[] targetClientIdBytes = nettyProxyMsg.getData();
String fromClientId = new String(fromClientIdBytes);
String toClientId = new String(toClientIdBytes);
String originClientId = new String(originClientIdBytes);
String targetClientId = new String(targetClientIdBytes);
Integer visitorPort = Integer.parseInt(new String(visitorPortBytes));
String clientTargetIp = new String(clientTargetIpBytes);
Integer clientTargetPort = Integer.parseInt(new String(clientTargetPortBytes));
@@ -50,17 +51,17 @@ public class ClientHandleTcpDistributeClientPermeateClientInitTypeAdvanced exten
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
// ChannelFlowAdapter channelFlowAdapter = SpringContextHolder.getBean(ChannelFlowAdapter.class);
NettyClientProperties nettyClientProperties = SpringContextHolder.getBean(NettyClientProperties.class);
log.info("client permeate client from client_id:【{}】 to_client_id【{}】with visitor_port【{}】, clientTargetIp:【{}】clientTargetPort:【{}】",
fromClientId, toClientId, visitorPort, clientTargetIp, clientTargetPort);
log.info("client permeate client from client_id:【{}】 target_client_id【{}】with visitor_port【{}】, clientTargetIp:【{}】clientTargetPort:【{}】",
originClientId, targetClientId, visitorPort, clientTargetIp, clientTargetPort);
NettyTcpClientPermeateClientVisitorSocket nettyTcpClientPermeateClientVisitorSocket =
NettyTcpClientPermeateClientVisitorSocket.NettyClientPermeateClientVisitorSocketBuilder.builder()
.builderClientId(fromClientId)
.builderClientId(originClientId)
.builderClientTargetIp(clientTargetIp)
.builderClientTargetPort(clientTargetPort)
.builderVisitorPort(visitorPort)
.builderNettyClientProperties(nettyClientProperties)
//.builderChannelFlowAdapter(channelFlowAdapter)
.builderToClientId(toClientId)
.builderToClientId(targetClientId)
.builderHandleChannelTypeAdvancedList(handleChannelTypeAdvancedList)
.build();

View File

@@ -43,8 +43,8 @@ public class ClientHandleTcpDistributeClientPermeateServerInitTypeAdvanced exten
// 初始化 客户端渗透服务端socket
byte[] clientIdBytes = nettyProxyMsg.getClientId();
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
NettyTcpClientPermeateServerVisitorSocket nettyTcpClientPermeateServerVisitorSocket = NettyTcpClientPermeateServerVisitorSocket.NettyVisitorSocketBuilder.builder()

View File

@@ -34,8 +34,8 @@ public class ClientHandleTcpDistributeClientPermeateServerTransferTypeAdvanced e
Channel channel = nettyChannelContext.channel();
log.debug("客户端渗透服务端返回数据:{}" , new String(nettyProxyMsg.getData()));
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
byte[] visitorId = nettyProxyMsg.getVisitorId();
// 真实服务通道
// Channel realChannel = NettyRealIdContext.getReal(new String(visitorId));

View File

@@ -37,8 +37,8 @@ public class ClientHandleTcpDistributeClientTransferClientPermeateChannelConnect
public void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
// 创建connect 然后发送创建成功
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
byte[] msgVisitorPort = nettyProxyMsg.getVisitorPort();

View File

@@ -36,8 +36,8 @@ public class ClientHandleTcpDistributeClientTransferClientPermeateChannelInitSuc
Channel channel = nettyChannelContext.channel();
// 连接成功 开启自动读取写
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
byte[] msgVisitorPort = nettyProxyMsg.getVisitorPort();

View File

@@ -41,8 +41,8 @@ public class ClientHandleTcpDistributeServicePermeateClientRealConnectTypeAdvanc
// 创建真实端口监听
byte[] clientIdBytes = msg.getClientId();
byte[] visitorPort = msg.getVisitorPort();
byte[] clientTargetIp = msg.getClientTargetIp();
byte[] clientTargetPort = msg.getClientTargetPort();
byte[] clientTargetIp = msg.getTargetIp();
byte[] clientTargetPort = msg.getTargetPort();
byte[] visitorIdBytes = msg.getVisitorId();
InternalNetworkPenetrationRealClient internalNetworkPenetrationRealClient =
InternalNetworkPenetrationRealClient

View File

@@ -8,9 +8,9 @@ import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.netty.permeate.tcp.socket.NettyTcpClientSocket;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import java.nio.charset.StandardCharsets;
import java.util.Date;
@@ -56,7 +56,7 @@ public class NettyTcpClientHandler extends SimpleChannelInboundHandler<NettyProx
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
// 建立连接时
log.info("When establishing a connection{}" , new Date());
log.info("When establishing a connection{}", new Date());
ctx.fireChannelActive();
String clientId = nettyTcpClientSocket.getClientId();
// 处理客户端连接成功
@@ -65,8 +65,6 @@ public class NettyTcpClientHandler extends SimpleChannelInboundHandler<NettyProx
nettyMsg.setType(TcpMessageType.TCP_CLIENT_CHANNEL_ACTIVE);
nettyMsg.setClientId(clientId);
channelTypeAdapter.handler(ctx, nettyMsg);
}
/**
@@ -75,8 +73,8 @@ public class NettyTcpClientHandler extends SimpleChannelInboundHandler<NettyProx
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
//服务端主动关闭当前客户端连接时
log.info("When the server actively closes the current client connection{}" , new Date());
final EventLoop eventLoop = ctx.channel().eventLoop();
log.info("When the server actively closes the current client connection{}", new Date());
EventLoop eventLoop = ctx.channel().eventLoop();
eventLoop.schedule(() -> {
try {
nettyTcpClientSocket.newConnect2Server();

View File

@@ -139,8 +139,8 @@ public class NettyTcpClientPermeateClientRealSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setTargetIp(clientTargetIp);
nettyProxyMsg.setTargetPort(clientTargetPort);
nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setType(TcpMessageType.TCP_REPORT_CLIENT_PERMEATE_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -141,7 +141,7 @@ public class NettyTcpClientPermeateClientVisitorSocket implements PermeateVisito
/**
* 目标客户端ID
*/
private String toClientId;
private String targetClientId;
/**
* 流量适配器
@@ -249,11 +249,11 @@ public class NettyTcpClientPermeateClientVisitorSocket implements PermeateVisito
/**
* 目标客户端ID
*
* @param toClientId 目标客户端ID
* @param targetClientId 目标客户端ID
* @return 当前对象
*/
public NettyClientPermeateClientVisitorSocketBuilder builderToClientId(String toClientId) {
this.toClientId = toClientId;
public NettyClientPermeateClientVisitorSocketBuilder builderToClientId(String targetClientId) {
this.targetClientId = targetClientId;
return this;
}
public NettyTcpClientPermeateClientVisitorSocket build() {
@@ -268,8 +268,8 @@ public class NettyTcpClientPermeateClientVisitorSocket implements PermeateVisito
}
NettyClientPermeateClientVisitor nettyClientPermeateClientVisitor = new NettyClientPermeateClientVisitor();
nettyClientPermeateClientVisitor.setFromClientId(nettyClientProperties.getClientId());
nettyClientPermeateClientVisitor.setToClientId(toClientId);
nettyClientPermeateClientVisitor.setOriginClientId(nettyClientProperties.getClientId());
nettyClientPermeateClientVisitor.setTargetClientId(targetClientId);
nettyClientPermeateClientVisitor.setTargetIp(clientTargetIp);
nettyClientPermeateClientVisitor.setTargetPort(clientTargetPort);
nettyClientPermeateClientVisitor.setVisitorPort(visitorPort);

View File

@@ -57,10 +57,10 @@ public class NettyTcpClientPermeateClientVisitorTransferSocket {
String visitorId = ChannelAttributeKeyUtils.getVisitorId(visitorChannel);
Integer visitorPort = nettyClientPermeateClientVisitor.getVisitorPort();
String toClientId = nettyClientPermeateClientVisitor.getToClientId();
String targetClientId = nettyClientPermeateClientVisitor.getTargetClientId();
// 客户端新建访客通道 连接服务端IP:{},连接服务端端口:{}
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 toClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, toClientId, visitorId);
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 targetClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, targetClientId, visitorId);
ChannelFuture future = bootstrap.connect(inetHost, inetPort);
// 使用的客户端ID:{}
@@ -70,11 +70,12 @@ public class NettyTcpClientPermeateClientVisitorTransferSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(TcpMessageType.TCP_REPORT_CLIENT_TRANSFER_CLIENT_PERMEATE_CHANNEL_CONNECTION_SUCCESSFUL);
// other clientId
nettyProxyMsg.setClientId(toClientId);
nettyProxyMsg.setClientId(targetClientId);
nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setVisitorId(visitorId);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -74,8 +74,8 @@ public class NettyTcpClientPermeateServerVisitorTransferSocket {
myMsg.setType(TcpMessageType.TCP_REPORT_CLIENT_TRANSFER_SERVER_PERMEATE_CHANNEL_CONNECTION_SUCCESSFUL);
myMsg.setClientId(clientId);
myMsg.setVisitorPort(visitorPort);
myMsg.setClientTargetIp(targetIp);
myMsg.setClientTargetPort(targetPort);
myMsg.setTargetIp(targetIp);
myMsg.setTargetPort(targetPort);
myMsg.setVisitorId(visitorId);
ChannelAttributeKeyUtils.buildVisitorId(transferChannel, visitorId);
ChannelAttributeKeyUtils.buildClientId(transferChannel, clientId);

View File

@@ -10,11 +10,11 @@ import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.netty.permeate.NettyClientSocket;
import org.framework.lazy.cloud.network.heartbeat.client.netty.permeate.event.ClientChangeEvent;
import org.framework.lazy.cloud.network.heartbeat.client.netty.permeate.tcp.filter.NettyTcpClientFilter;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.NettyServerContext;
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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import java.net.InetAddress;
@@ -41,10 +41,6 @@ public class NettyTcpClientSocket implements NettyClientSocket {
@Getter
private final String clientId;
/**
* 当前连接的服务端ID
*/
private final String serverId;
private final String appKey;
private final String appSecret;
/**
@@ -57,7 +53,6 @@ public class NettyTcpClientSocket implements NettyClientSocket {
public NettyTcpClientSocket(String inetHost,
int inetPort,
String clientId,
String serverId,
String appKey,
String appSecret,
ClientChangeEvent clientChangeEvent,
@@ -65,7 +60,6 @@ public class NettyTcpClientSocket implements NettyClientSocket {
this.inetHost = inetHost;
this.inetPort = inetPort;
this.clientId = clientId;
this.serverId = serverId;
this.appKey = appKey;
this.appSecret = appSecret;
this.clientChangeEvent = clientChangeEvent;
@@ -73,7 +67,7 @@ public class NettyTcpClientSocket implements NettyClientSocket {
}
protected void newTcpConnect2Server(String inetHost, int inetPort, String clientId, String serverId, ClientChangeEvent clientChangeEvent) throws InterruptedException {
protected void newTcpConnect2Server(String inetHost, int inetPort, String clientId, ClientChangeEvent clientChangeEvent) throws InterruptedException {
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(eventLoopGroup)
.channel(NioSocketChannel.class)
@@ -88,7 +82,7 @@ public class NettyTcpClientSocket implements NettyClientSocket {
.option(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(1024 * 1024, 1024 * 1024 * 2))
.handler(new NettyTcpClientFilter(new ChannelTypeAdapter(handleChannelTypeAdvancedList), this))
;
log.info("use clientId:{} connect to server IP:{},server port :{}", clientId, inetHost, inetPort);
log.info("use clientId:{} connect to server IP:{},server port :{}", clientId, inetHost, inetPort);
ChannelFuture future = bootstrap.connect(inetHost, inetPort);
// 客户端连接服务端的channel
Channel serviceChannel = future.channel();
@@ -96,7 +90,7 @@ public class NettyTcpClientSocket implements NettyClientSocket {
future.addListener((ChannelFutureListener) futureListener -> {
if (futureListener.isSuccess()) {
log.info("clientId:{},connect to server IP:{},server port :{} isSuccess ", clientId, inetHost, inetPort);
log.info("clientId:{},connect to server IP:{},server port :{} isSuccess ", clientId, inetHost, inetPort);
// 告诉服务端这条连接是client的连接
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(TcpMessageType.TCP_REPORT_CLIENT_CONNECT_SUCCESS);
@@ -109,17 +103,17 @@ public class NettyTcpClientSocket implements NettyClientSocket {
ChannelAttributeKeyUtils.buildClientId(serviceChannel, clientId);
serviceChannel.writeAndFlush(nettyMsg);
NettyServerContext.pushServerEndpointChannel(serverId, clientId, serviceChannel);
NettyServerContext.pushServerEndpointChannel(clientId, serviceChannel);
// 在线 客户端注册服务端成功
clientChangeEvent.clientOnLine(inetHost, inetPort,serverId, clientId);
clientChangeEvent.clientOnLine(inetHost, inetPort, clientId);
} else {
log.warn("Reconnect every 2 seconds....");
// 离线
NettyServerContext.removeServerEndpointChannels(serverId, clientId);
clientChangeEvent.clientOffLine(inetHost, inetPort,serverId, clientId);
NettyServerContext.removeServerEndpointChannels(clientId);
clientChangeEvent.clientOffLine(inetHost, inetPort, clientId);
eventLoopGroup.schedule(() -> {
try {
newTcpConnect2Server(inetHost, inetPort, clientId, serverId, clientChangeEvent);
newTcpConnect2Server(inetHost, inetPort, clientId, clientChangeEvent);
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -145,6 +139,6 @@ public class NettyTcpClientSocket implements NettyClientSocket {
*/
@Override
public void newConnect2Server() throws InterruptedException {
newTcpConnect2Server(inetHost, inetPort, clientId, serverId, clientChangeEvent);
newTcpConnect2Server(inetHost, inetPort, clientId, clientChangeEvent);
}
}

View File

@@ -181,8 +181,8 @@ public class NettyTcpServerPermeateClientRealSocket {
myMsg.setType(TcpMessageType.TCP_REPORT_SINGLE_CLIENT_REAL_CONNECT);
myMsg.setClientId(visitorClientId);
myMsg.setVisitorPort(visitorPort);
myMsg.setClientTargetIp(clientTargetIp);
myMsg.setClientTargetPort(clientTargetPort);
myMsg.setTargetIp(clientTargetIp);
myMsg.setTargetPort(clientTargetPort);
myMsg.setVisitorId(visitorId);
transferChannel.writeAndFlush(myMsg);

View File

@@ -41,8 +41,8 @@ public class ClientHandleUdpChannelTransferTypeAdvancedHandleDistribute extends
log.debug("接收到服务端需要内网穿透的数据:{}" , nettyProxyMsg);
String clientId = nettyClientProperties.getClientId();
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
byte[] visitorId = nettyProxyMsg.getVisitorId();
// 真实服务通道
// Channel realChannel = NettyRealIdContext.getReal(new String(visitorId));

View File

@@ -33,6 +33,7 @@ public class ClientHandleUdpClientChannelActiveAdvanced extends AbstractHandleUd
// 缓存当前通道
byte[] clientIdByte = nettyProxyMsg.getClientId();
String clientId = new String(clientIdByte);
String serverId = new String(clientIdByte);
ChannelContext.push(channel, clientId);
ChannelAttributeKeyUtils.buildClientId(channel, clientId);
}

View File

@@ -35,14 +35,14 @@ public class ClientHandleUdpDistributeClientPermeateClientInitTypeAdvanced exten
@Override
public void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
// 初始化 客户端渗透服务端socket
byte[] fromClientIdBytes = nettyProxyMsg.getClientId();
byte[] originClientIdBytes = nettyProxyMsg.getClientId();
byte[] visitorPortBytes = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIpBytes = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPortBytes = nettyProxyMsg.getClientTargetPort();
byte[] toClientIdBytes = nettyProxyMsg.getData();
byte[] clientTargetIpBytes = nettyProxyMsg.getTargetIp();
byte[] clientTargetPortBytes = nettyProxyMsg.getTargetPort();
byte[] targetClientIdBytes = nettyProxyMsg.getData();
String fromClientId = new String(fromClientIdBytes);
String toClientId = new String(toClientIdBytes);
String originClientId = new String(originClientIdBytes);
String targetClientId = new String(targetClientIdBytes);
Integer visitorPort = Integer.parseInt(new String(visitorPortBytes));
String clientTargetIp = new String(clientTargetIpBytes);
Integer clientTargetPort = Integer.parseInt(new String(clientTargetPortBytes));
@@ -50,17 +50,17 @@ public class ClientHandleUdpDistributeClientPermeateClientInitTypeAdvanced exten
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
// ChannelFlowAdapter channelFlowAdapter = SpringContextHolder.getBean(ChannelFlowAdapter.class);
NettyClientProperties nettyClientProperties = SpringContextHolder.getBean(NettyClientProperties.class);
log.info("client permeate client from client_id:【{}】 to_client_id【{}】with visitor_port【{}】, clientTargetIp:【{}】clientTargetPort:【{}】",
fromClientId, toClientId, visitorPort, clientTargetIp, clientTargetPort);
log.info("client permeate client from client_id:【{}】 target_client_id【{}】with visitor_port【{}】, clientTargetIp:【{}】clientTargetPort:【{}】",
originClientId, targetClientId, visitorPort, clientTargetIp, clientTargetPort);
NettyUdpClientPermeateClientVisitorSocket nettyTcpClientPermeateClientVisitorSocket =
NettyUdpClientPermeateClientVisitorSocket.NettyClientPermeateClientVisitorSocketBuilder.builder()
.builderClientId(fromClientId)
.builderClientId(originClientId)
.builderClientTargetIp(clientTargetIp)
.builderClientTargetPort(clientTargetPort)
.builderVisitorPort(visitorPort)
.builderNettyClientProperties(nettyClientProperties)
// .builderChannelFlowAdapter(channelFlowAdapter)
.builderToClientId(toClientId)
.builderToClientId(targetClientId)
.builderHandleChannelTypeAdvancedList(handleChannelTypeAdvancedList)
.build();

View File

@@ -43,8 +43,8 @@ public class ClientHandleUdpDistributeClientPermeateServerInitTypeAdvanced exten
// 初始化 客户端渗透服务端socket
byte[] clientIdBytes = nettyProxyMsg.getClientId();
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
NettyUdpClientPermeateServerVisitorSocket nettyTcpClientPermeateServerVisitorSocket = NettyUdpClientPermeateServerVisitorSocket.NettyVisitorSocketBuilder.builder()

View File

@@ -34,8 +34,8 @@ public class ClientHandleUdpDistributeClientPermeateServerTransferTypeAdvanced e
Channel channel = nettyChannelContext.channel();
log.debug("客户端渗透服务端返回数据:{}" , new String(nettyProxyMsg.getData()));
byte[] visitorPort = nettyProxyMsg.getVisitorPort();
byte[] clientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] clientTargetIp = nettyProxyMsg.getTargetIp();
byte[] clientTargetPort = nettyProxyMsg.getTargetPort();
byte[] visitorId = nettyProxyMsg.getVisitorId();
// 真实服务通道
// Channel realChannel = NettyRealIdContext.getReal(new String(visitorId));

View File

@@ -36,8 +36,8 @@ public class ClientHandleUdpDistributeClientTransferClientPermeateChannelConnect
public void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
// 创建connect 然后发送创建成功
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
byte[] msgVisitorPort = nettyProxyMsg.getVisitorPort();

View File

@@ -36,8 +36,8 @@ public class ClientHandleUdpDistributeClientTransferClientPermeateChannelInitSuc
Channel channel = nettyChannelContext.channel();
// 连接成功 开启自动读取写
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
byte[] msgVisitorPort = nettyProxyMsg.getVisitorPort();

View File

@@ -40,8 +40,8 @@ public class ClientHandleUdpDistributeServicePermeateClientRealConnectTypeAdvanc
// 创建真实端口监听
byte[] clientIdBytes = msg.getClientId();
byte[] visitorPort = msg.getVisitorPort();
byte[] clientTargetIp = msg.getClientTargetIp();
byte[] clientTargetPort = msg.getClientTargetPort();
byte[] clientTargetIp = msg.getTargetIp();
byte[] clientTargetPort = msg.getTargetPort();
byte[] visitorIdBytes = msg.getVisitorId();
InternalNetworkPenetrationRealClient internalNetworkPenetrationRealClient =
InternalNetworkPenetrationRealClient

View File

@@ -59,11 +59,13 @@ public class NettyUdpClientHandler extends SimpleChannelInboundHandler<NettyProx
log.info("When establishing a connection{}" , new Date());
ctx.fireChannelActive();
String clientId = nettyUdpClientSocket.getClientId();
// 处理客户端连接成功
Channel channel = ctx.channel();
NettyProxyMsg nettyMsg = new NettyProxyMsg();
nettyMsg.setType(UdpMessageType.UDP_CLIENT_CHANNEL_ACTIVE);
nettyMsg.setClientId(clientId);
channelTypeAdapter.handler(ctx, nettyMsg);

View File

@@ -139,8 +139,8 @@ public class NettyUdpClientPermeateClientRealSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setTargetIp(clientTargetIp);
nettyProxyMsg.setTargetPort(clientTargetPort);
nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setType(UdpMessageType.UDP_REPORT_CLIENT_PERMEATE_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -140,7 +140,7 @@ public class NettyUdpClientPermeateClientVisitorSocket implements PermeateVisito
/**
* 目标客户端ID
*/
private String toClientId;
private String targetClientId;
/**
* 流量适配器
@@ -248,11 +248,11 @@ public class NettyUdpClientPermeateClientVisitorSocket implements PermeateVisito
/**
* 目标客户端ID
*
* @param toClientId 目标客户端ID
* @param targetClientId 目标客户端ID
* @return 当前对象
*/
public NettyClientPermeateClientVisitorSocketBuilder builderToClientId(String toClientId) {
this.toClientId = toClientId;
public NettyClientPermeateClientVisitorSocketBuilder builderToClientId(String targetClientId) {
this.targetClientId = targetClientId;
return this;
}
public NettyUdpClientPermeateClientVisitorSocket build() {
@@ -267,8 +267,8 @@ public class NettyUdpClientPermeateClientVisitorSocket implements PermeateVisito
}
NettyClientPermeateClientVisitor nettyClientPermeateClientVisitor = new NettyClientPermeateClientVisitor();
nettyClientPermeateClientVisitor.setFromClientId(nettyClientProperties.getClientId());
nettyClientPermeateClientVisitor.setToClientId(toClientId);
nettyClientPermeateClientVisitor.setOriginClientId(nettyClientProperties.getClientId());
nettyClientPermeateClientVisitor.setTargetClientId(targetClientId);
nettyClientPermeateClientVisitor.setTargetIp(clientTargetIp);
nettyClientPermeateClientVisitor.setTargetPort(clientTargetPort);
nettyClientPermeateClientVisitor.setVisitorPort(visitorPort);

View File

@@ -57,10 +57,10 @@ public class NettyUdpClientPermeateClientVisitorTransferSocket {
String visitorId = ChannelAttributeKeyUtils.getVisitorId(visitorChannel);
Integer visitorPort = nettyClientPermeateClientVisitor.getVisitorPort();
String toClientId = nettyClientPermeateClientVisitor.getToClientId();
String targetClientId = nettyClientPermeateClientVisitor.getTargetClientId();
// 客户端新建访客通道 连接服务端IP:{},连接服务端端口:{}
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 toClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, toClientId, visitorId);
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 targetClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, targetClientId, visitorId);
ChannelFuture future = bootstrap.connect(inetHost, inetPort);
// 使用的客户端ID:{}
@@ -71,10 +71,10 @@ public class NettyUdpClientPermeateClientVisitorTransferSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(UdpMessageType.UDP_REPORT_CLIENT_TRANSFER_CLIENT_PERMEATE_CHANNEL_CONNECTION_SUCCESSFUL);
// other clientId
nettyProxyMsg.setClientId(toClientId);
nettyProxyMsg.setClientId(targetClientId);
nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setVisitorId(visitorId);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -74,8 +74,8 @@ public class NettyUdpClientPermeateServerVisitorTransferSocket {
myMsg.setType(UdpMessageType.UDP_REPORT_CLIENT_TRANSFER_SERVER_PERMEATE_CHANNEL_CONNECTION_SUCCESSFUL);
myMsg.setClientId(clientId);
myMsg.setVisitorPort(visitorPort);
myMsg.setClientTargetIp(targetIp);
myMsg.setClientTargetPort(targetPort);
myMsg.setTargetIp(targetIp);
myMsg.setTargetPort(targetPort);
myMsg.setVisitorId(visitorId);
ChannelAttributeKeyUtils.buildVisitorId(transferChannel, visitorId);
ChannelAttributeKeyUtils.buildClientId(transferChannel, clientId);

View File

@@ -41,10 +41,6 @@ public class NettyUdpClientSocket implements NettyClientSocket {
@Getter
private final String clientId;
/**
* 当前连接的服务端ID
*/
private final String serverId;
private final String appKey;
private final String appSecret;
/**
@@ -57,7 +53,6 @@ public class NettyUdpClientSocket implements NettyClientSocket {
public NettyUdpClientSocket(String inetHost,
int inetPort,
String clientId,
String serverId,
String appKey,
String appSecret,
ClientChangeEvent clientChangeEvent,
@@ -65,7 +60,6 @@ public class NettyUdpClientSocket implements NettyClientSocket {
this.inetHost = inetHost;
this.inetPort = inetPort;
this.clientId = clientId;
this.serverId = serverId;
this.appKey = appKey;
this.appSecret = appSecret;
this.clientChangeEvent = clientChangeEvent;
@@ -73,10 +67,10 @@ public class NettyUdpClientSocket implements NettyClientSocket {
}
public void newConnect2Server() throws InterruptedException {
newConnect2Server(inetHost, inetPort, clientId, serverId, clientChangeEvent);
newConnect2Server(inetHost, inetPort, clientId, clientChangeEvent);
}
protected void newConnect2Server(String inetHost, int inetPort, String clientId, String serverId, ClientChangeEvent clientChangeEvent) throws InterruptedException {
protected void newConnect2Server(String inetHost, int inetPort, String clientId, ClientChangeEvent clientChangeEvent) throws InterruptedException {
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(eventLoopGroup)
.channel(NioDatagramChannel.class)
@@ -113,17 +107,17 @@ public class NettyUdpClientSocket implements NettyClientSocket {
ChannelAttributeKeyUtils.buildClientId(serviceChannel, clientId);
serviceChannel.writeAndFlush(nettyMsg);
NettyServerContext.pushServerEndpointChannel(serverId, clientId, serviceChannel);
NettyServerContext.pushServerEndpointChannel(clientId, serviceChannel);
// 在线 客户端注册服务端成功
clientChangeEvent.clientOnLine(inetHost, inetPort,serverId, clientId);
clientChangeEvent.clientOnLine(inetHost, inetPort, clientId);
} else {
log.warn("Reconnect every 2 seconds....");
// 离线
NettyServerContext.removeServerEndpointChannels(serverId, clientId);
clientChangeEvent.clientOffLine(inetHost, inetPort,serverId, clientId);
NettyServerContext.removeServerEndpointChannels(clientId);
clientChangeEvent.clientOffLine(inetHost, inetPort, clientId);
eventLoopGroup.schedule(() -> {
try {
newConnect2Server(inetHost, inetPort, clientId, serverId, clientChangeEvent);
newConnect2Server(inetHost, inetPort, clientId, clientChangeEvent);
} catch (InterruptedException e) {
e.printStackTrace();
}

View File

@@ -182,8 +182,8 @@ public class NettyUdpServerPermeateClientRealSocket {
myMsg.setType(UdpMessageType.UDP_REPORT_SINGLE_CLIENT_REAL_CONNECT);
myMsg.setClientId(visitorClientId);
myMsg.setVisitorPort(visitorPort);
myMsg.setClientTargetIp(clientTargetIp);
myMsg.setClientTargetPort(clientTargetPort);
myMsg.setTargetIp(clientTargetIp);
myMsg.setTargetPort(clientTargetPort);
myMsg.setVisitorId(visitorId);
transferChannel.writeAndFlush(myMsg);

View File

@@ -36,8 +36,8 @@ public class ClientHandleDistributeHttpClientProxyClientConnectionTransferSucces
// 客户端主动连接服务端创建一个传输通道
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
String clientId = new String(msgClientId);

View File

@@ -31,8 +31,8 @@ public class ClientHandleDistributeHttpServerProxyClientConnectionSuccessfulType
// 创建一个传输通道
byte[] msgClientId = nettyProxyMsg.getClientId();
byte[] msgClientTargetIp = nettyProxyMsg.getClientTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getClientTargetPort();
byte[] msgClientTargetIp = nettyProxyMsg.getTargetIp();
byte[] msgClientTargetPort = nettyProxyMsg.getTargetPort();
byte[] msgVisitorId = nettyProxyMsg.getVisitorId();
String clientId = new String(msgClientId);

View File

@@ -34,8 +34,8 @@ public class ClientHandleHttpClientProxyClientTypeAdvanced extends
@Override
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel channel = nettyChannelContext.channel();
String targetPortString = nettyProxyMsg.getTargetPortString();
String targetIpString = nettyProxyMsg.getTargetIpString();
String targetPortString = nettyProxyMsg.targetPort();
String targetIpString = nettyProxyMsg.targetIp();
byte[] data = nettyProxyMsg.getData();
byte[] clientId = nettyProxyMsg.getClientId();
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());

View File

@@ -34,8 +34,8 @@ public class ClientHandleHttpClientProxyServerTypeAdvanced extends
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel channel = nettyChannelContext.channel();
String targetPortString = nettyProxyMsg.getTargetPortString();
String targetIpString = nettyProxyMsg.getTargetIpString();
String targetPortString = nettyProxyMsg.targetPort();
String targetIpString = nettyProxyMsg.targetIp();
byte[] data = nettyProxyMsg.getData();
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
NettyClientProperties nettyClientProperties = SpringContextHolder.getBean(NettyClientProperties.class);

View File

@@ -3,7 +3,6 @@ package org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.http.socke
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.client.config.NettyClientProperties;
@@ -60,7 +59,7 @@ public class NettyHttpClientProxyClientProxySocket {
// 客户端链接服务端
log.info("Client creates a new proxy channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 toClientId:【{}】 & visitorId:【{}】",
log.info("Client creates a new proxy channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 targetClientId:【{}】 & visitorId:【{}】",
inetHost, inetPort, clientId, targetClientId, visitorId);
ChannelFuture future = bootstrap.connect(inetHost, inetPort);
@@ -73,8 +72,8 @@ public class NettyHttpClientProxyClientProxySocket {
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_);
// other clientId
nettyProxyMsg.setClientId(targetClientId);
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setData(data);
nettyProxyMsg.setVisitorId(visitorId);

View File

@@ -139,8 +139,8 @@ public class NettyHttpClientProxyClientRealSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setTargetIp(clientTargetIp);
nettyProxyMsg.setTargetPort(clientTargetPort);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -14,6 +14,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdap
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import java.net.InetAddress;
import java.util.concurrent.TimeUnit;
/**
@@ -63,7 +64,7 @@ public class NettyHttpClientProxyServerProxySocket {
// 客户端新建访客通道 连接服务端IP:{},连接服务端端口:{}
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 toClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, clientId, visitorId);
log.info("Client creates a new visitor channel to connect to server IP: {}, connecting to server port: {} with clientId:【{}】 targetClientId:【{}】 & visitorId:【{}】", inetHost, inetPort, clientId, clientId, visitorId);
ChannelFuture future = bootstrap.connect(inetHost, inetPort);
// 使用的客户端ID:{}
@@ -76,8 +77,10 @@ public class NettyHttpClientProxyServerProxySocket {
// other clientId
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
String hostAddress = InetAddress.getLocalHost().getHostAddress();
nettyProxyMsg.setOriginalIpString(hostAddress);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setData(data);
nettyProxyMsg.setVisitorId(visitorId);

View File

@@ -139,8 +139,8 @@ public class NettyHttpServerProxyClientRealSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setTargetIp(clientTargetIp);
nettyProxyMsg.setTargetPort(clientTargetPort);
nettyProxyMsg.setType(ProxyMessageType.HTTP_REPORT_SERVER_PROXY_CLIENT_TRANSFER_CHANNEL_INIT_SUCCESSFUL_);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -32,10 +32,10 @@ public class ClientHandleDistributeSocksClientProxyClientOtherConnectionTransfer
@Override
protected void doHandler(NettyChannelContext nettyChannelContext, NettyProxyMsg nettyProxyMsg) {
Channel channel = nettyChannelContext.channel();
String clientId = nettyProxyMsg.getClientIdString();
String clientId = nettyProxyMsg.clientId();
byte[] visitorId = nettyProxyMsg.getVisitorId();
String targetIp = nettyProxyMsg.getTargetIpString();
Integer targetPort = Integer.parseInt(nettyProxyMsg.getTargetPortString());
String targetIp = nettyProxyMsg.targetIp();
Integer targetPort = Integer.parseInt(nettyProxyMsg.targetPort());
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());
NettyClientProperties nettyClientProperties = SpringContextHolder.getBean(NettyClientProperties.class);

View File

@@ -37,8 +37,8 @@ public class ClientHandleNettySocketProtocolHandleSocketClientProxyClientStartTy
NettySocketChannelContext nettySocketChannelContext = (NettySocketChannelContext) nettyChannelContext;
Channel proxyChannel = nettySocketChannelContext.channel();
String host = nettyProxyMsg.getTargetIpString();
Integer port = Integer.parseInt(nettyProxyMsg.getTargetPortString());
String host = nettyProxyMsg.targetIp();
Integer port = Integer.parseInt(nettyProxyMsg.targetPort());
byte[] clientId = nettyProxyMsg.getClientId();
byte[] visitorId = nettyProxyMsg.getVisitorId();

View File

@@ -40,8 +40,8 @@ public class ClientHandleNettySocketProtocolHandleSocketClientProxyServerStartTy
NettySocketChannelContext nettySocketChannelContext = (NettySocketChannelContext) nettyChannelContext;
Channel proxyChannel = nettySocketChannelContext.channel();
String host = nettyProxyMsg.getTargetIpString();
Integer port = Integer.parseInt(nettyProxyMsg.getTargetPortString());
String host = nettyProxyMsg.targetIp();
Integer port = Integer.parseInt(nettyProxyMsg.targetPort());
Socks5AddressType socks5AddressType = nettySocketChannelContext.getSocks5AddressType();

View File

@@ -1,7 +1,6 @@
package org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.advanced;
import io.netty.channel.Channel;
import io.netty.handler.codec.socksx.v5.Socks5AddressType;
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.socks.NettySocksClientProxyClient;
@@ -37,10 +36,10 @@ public class ClientHandleSocksDistributeServerProxyClientConnectionInitTypeAdvan
// 绑定真实通道
Channel channel = nettyChannelContext.channel();
String clientId = nettyProxyMsg.getClientIdString();
String clientId = nettyProxyMsg.clientId();
byte[] visitorId = nettyProxyMsg.getVisitorId();
String targetIp = nettyProxyMsg.getTargetIpString();
Integer targetPort = Integer.parseInt(nettyProxyMsg.getTargetPortString());
String targetIp = nettyProxyMsg.targetIp();
Integer targetPort = Integer.parseInt(nettyProxyMsg.targetPort());
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList = new ArrayList<>(SpringContextHolder.getApplicationContext().getBeansOfType(HandleChannelTypeAdvanced.class).values());

View File

@@ -63,6 +63,8 @@ public class NettySocksServerProxyClientTransferHandler extends SimpleChannelInb
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
log.error(cause.getMessage());
super.exceptionCaught(ctx, cause);
}
}

View File

@@ -134,8 +134,8 @@ public class NettySocksClientProxyClientRealSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(clientTargetIp);
nettyProxyMsg.setClientTargetPort(clientTargetPort);
nettyProxyMsg.setTargetIp(clientTargetIp);
nettyProxyMsg.setTargetPort(clientTargetPort);
nettyProxyMsg.setType(ProxyMessageType.SOCKS_REPORT_CLIENT_PROXY_CLIENT_OTHER_TRANSFER_CONNECTION_SUCCESS_);
transferChannel.writeAndFlush(nettyProxyMsg);

View File

@@ -9,7 +9,6 @@ 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.socks.NettySocksClientProxyClient;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.filter.NettySocksClientProxyClientVisitorTransferFilter;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.filter.NettySocksClientProxyServerTransferFilter;
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelTypeAdapter;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.constant.ProxyMessageType;
@@ -69,9 +68,10 @@ public class NettySocksClientProxyClientVisitorTransferSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(ProxyMessageType.SOCKS_REPORT_CLIENT_PROXY_CLIENT_TRANSFER_CONNECTION_);
// other clientId
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setClientId(targetClientId);
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setData(new byte[]{socks5AddressTypeByteValue});

View File

@@ -69,8 +69,8 @@ public class NettySocksClientProxyServerSocket {
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(ProxyMessageType.SOCKS_REPORT_CLIENT_PROXY_SERVER_TRANSFER_CONNECTION_);
// other clientId
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setVisitorId(visitorId);

View File

@@ -6,8 +6,6 @@ import io.netty.channel.*;
import io.netty.channel.socket.nio.NioSocketChannel;
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.socks.filter.NettySocksClientProxyClientRealFilter;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.filter.NettySocksClientProxyClientTransferFilter;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.filter.NettySocksServerProxyClientRealFilter;
import org.framework.lazy.cloud.network.heartbeat.client.netty.proxy.socks.filter.NettySocksServerProxyClientTransferFilter;
import org.framework.lazy.cloud.network.heartbeat.common.NettyRealIdContext;
@@ -130,24 +128,23 @@ public class NettySocksServerProxyClientRealSocket {
Channel transferChannel = futureListener.channel();
if (futureListener.isSuccess()) {
log.info("服务端代理客户端socks客户端连接服务端传输通道成功");
realChannel.config().setOption(ChannelOption.AUTO_READ, true);
// 通知服务端访客连接成功
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setClientTargetIp(targetIp);
nettyProxyMsg.setClientTargetPort(targetPort);
nettyProxyMsg.setType(ProxyMessageType.SOCKS_REPORT_SERVER_PROXY_CLIENT_CONNECTION_SUCCESS_);
transferChannel.writeAndFlush(nettyProxyMsg);
// 绑定下一个通道
ChannelAttributeKeyUtils.buildNextChannel(transferChannel, realChannel);
ChannelAttributeKeyUtils.buildNextChannel(realChannel, transferChannel);
// 绑定客户端真实通信通道
ChannelAttributeKeyUtils.buildVisitorId(transferChannel, visitorId);
ChannelAttributeKeyUtils.buildClientId(transferChannel, clientId);
// 开始读取数据
realChannel.config().setOption(ChannelOption.AUTO_READ, true);
// 通知服务端访客连接成功
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setTargetIp(targetIp);
nettyProxyMsg.setTargetPort(targetPort);
nettyProxyMsg.setType(ProxyMessageType.SOCKS_REPORT_SERVER_PROXY_CLIENT_CONNECTION_SUCCESS_);
transferChannel.writeAndFlush(nettyProxyMsg);
} else {
log.info("无法连接到服务端....");
eventLoopGroup.schedule(() -> {

View File

@@ -5,7 +5,7 @@
<link rel="icon" href="./favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Java 使用 Lazy ORM 网络穿透客户端!</title>
<script type="module" crossorigin src="./assets/index-DjZ671Nk.js"></script>
<script type="module" crossorigin src="./assets/index-BmaHpnnF.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BEQZ9T9z.css">
</head>
<body>

View File

@@ -6,28 +6,57 @@
<parent>
<groupId>top.wu2020</groupId>
<artifactId>wu-lazy-cloud-network</artifactId>
<version>1.3.1-JDK17-SNAPSHOT</version>
<version>1.3.2-JDK24</version>
</parent>
<artifactId>wu-lazy-cloud-heartbeat-common</artifactId>
<description>wlcn项目通用模块</description>
<name>wlcn项目通用模块</name>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
<!-->开发者的信息<-->
<developers>
<developer>
<name>Jia Wei Wu</name>
<email>1207537021@qq.com</email>
</developer>
</developers>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<!-->项目的版本管理地址<-->
<scm>
<url>https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network</url>
</scm>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>24</maven.compiler.source>
<maven.compiler.target>24</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.122.Final</version>
</dependency>
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-framework-web</artifactId>
<version>${wu-framework-web.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>${spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>top.wu2020</groupId>
<artifactId>wu-framework-queue</artifactId>
<version>1.3.2-JDK24</version>
</dependency>
</dependencies>

View File

@@ -19,8 +19,9 @@ import java.util.stream.Collectors;
@Slf4j
public class ChannelContext {
private final static ConcurrentHashMap<String/*clientId*/, List<Channel>/*通道*/>
channelIdClientChannelDTOConcurrentHashMap = new ConcurrentHashMap<>();
private final static
ConcurrentHashMap<String/*clientId*/, List<Channel>/*通道*/>
cacheClientChannelConcurrentHashMap = new ConcurrentHashMap<>();
/**
* 新增通道
@@ -29,25 +30,24 @@ public class ChannelContext {
* @param clientId 客户端ID
*/
public static void push(Channel channel, String clientId) {
// 如果客户端已经存在 移除
if (channelIdClientChannelDTOConcurrentHashMap.containsKey(clientId)) {
// clear(clientId);
// 如果服务端已经存在 移除
if (cacheClientChannelConcurrentHashMap.containsKey(clientId)) {
List<Channel> existChannelList = new ArrayList<>();
List<Channel> oldChannels = channelIdClientChannelDTOConcurrentHashMap.get(clientId);
List<Channel> oldChannels = cacheClientChannelConcurrentHashMap.get(clientId);
for (Channel existChannel : oldChannels) {
if (existChannel != null) {
if(existChannel.isActive()){
if (existChannel.isActive()) {
existChannelList.add(existChannel);
}else {
log.warn("close channel with client:{}", ChannelAttributeKeyUtils.getClientId(existChannel));
} else {
log.warn("close channel with client:{}", ChannelAttributeKeyUtils.getClientId(existChannel));
existChannel.close();
}
}
}
existChannelList.add(channel);
channelIdClientChannelDTOConcurrentHashMap.put(clientId, existChannelList);
}else {
channelIdClientChannelDTOConcurrentHashMap.putIfAbsent(clientId, Collections.synchronizedList(new ArrayList<>(List.of(channel))));
cacheClientChannelConcurrentHashMap.put(clientId, existChannelList);
} else {
cacheClientChannelConcurrentHashMap.putIfAbsent(clientId, Collections.synchronizedList(new ArrayList<>(List.of(channel))));
}
}
@@ -58,25 +58,26 @@ public class ChannelContext {
* @param channel 通道
* @param clientId 客户端ID
*/
public static void push(Channel channel, byte[] clientId) {
push(channel,new String(clientId, StandardCharsets.UTF_8));
public static void push(Channel channel, byte[] clientId) {
push(channel, new String(clientId, StandardCharsets.UTF_8));
}
/**
* 获取指定服务端所有通道
*
* @return 返回所有通道信息
*/
public static ConcurrentMap<String/*clientId*/, List<Channel>/*通道*/> getChannels() {
return cacheClientChannelConcurrentHashMap;
}
/**
* 获取所有通道
*
* @return 返回所有通道信息
*/
public static ConcurrentMap<String/*clientId*/, List<Channel>/*通道*/> getChannels() {
return channelIdClientChannelDTOConcurrentHashMap;
}
/**
* 获取所有通道
*
* @return 返回所有通道信息
*/
public static List<String> getClientIds() {
return new ArrayList<>(channelIdClientChannelDTOConcurrentHashMap.keySet().stream().toList());
return new ArrayList<>(cacheClientChannelConcurrentHashMap.keySet().stream().toList());
}
@@ -87,15 +88,15 @@ public class ChannelContext {
* @return 通道信息
*/
public static List<Channel> get(byte[] clientId) {
if (channelIdClientChannelDTOConcurrentHashMap
.containsKey(new String(clientId))) {
return channelIdClientChannelDTOConcurrentHashMap
.get(new String(clientId));
} else {
try {
return cacheClientChannelConcurrentHashMap.get(new String(clientId, StandardCharsets.UTF_8));
} catch (Exception e) {
e.printStackTrace();
// 无法通过客户端ID[{}]获取通道信息
log.error("Unable to obtain channel information through client ID [{}]",new String(clientId));
log.error("Unable to obtain channel information through client ID [{}]", new String(clientId));
return null;
}
}
/**
@@ -107,6 +108,7 @@ public class ChannelContext {
public static List<Channel> get(String clientId) {
return get(clientId.getBytes(StandardCharsets.UTF_8));
}
/**
* 根据通道ID获取通道信息
*
@@ -115,11 +117,11 @@ public class ChannelContext {
*/
public static Channel getLoadBalance(byte[] clientId) {
List<Channel> channels = get(clientId);
if(ObjectUtils.isEmpty(channels)){
if (ObjectUtils.isEmpty(channels)) {
return null;
}
channels = channels.stream().filter(Channel::isActive).collect(Collectors.toList());
if(ObjectUtils.isEmpty(channels)){
if (ObjectUtils.isEmpty(channels)) {
return null;
}
// TODO 负载问题
@@ -153,7 +155,7 @@ public class ChannelContext {
} else {
// log warm
// 无法通过客户ID:[{}]移除客户端
log.warn("Unable to remove client through customer ID: [{}]", clientId);
log.warn("Unable to remove client through clientId: [{}]", clientId);
}
}
@@ -165,10 +167,10 @@ public class ChannelContext {
public static void remove(byte[] clientId) {
List<Channel> clientChannel = get(clientId);
if (clientChannel != null) {
channelIdClientChannelDTOConcurrentHashMap.remove(new String(clientId));
cacheClientChannelConcurrentHashMap.remove(new String(clientId, StandardCharsets.UTF_8));
} else {
// log warm 无法通过客户ID:[{}]移除客户端
log.warn("Unable to remove client through customer ID: [{}]", new String(clientId));
log.warn("Unable to remove client through clientId: [{}]", new String(clientId));
}
}
@@ -180,10 +182,10 @@ public class ChannelContext {
public static void remove(String clientId) {
List<Channel> clientChannel = get(clientId);
if (clientChannel != null) {
channelIdClientChannelDTOConcurrentHashMap.remove(clientId);
cacheClientChannelConcurrentHashMap.remove(clientId);
} else {
// log warm 无法通过客户ID:[{}]移除客户端
log.warn("Unable to remove client through customer ID: [{}]", clientId);
log.warn("Unable to remove client through clientId: {}", clientId);
}
}

View File

@@ -16,6 +16,7 @@ import lombok.experimental.Accessors;
public class InternalNetworkPenetrationRealClient {
/**
* 客户端ID
*/

View File

@@ -19,9 +19,5 @@ public class NettyClientChannel {
* 客户端通道
*/
private Channel channel;
/**
* 服务端ID
*/
private String serverId;
}

View File

@@ -1,7 +1,6 @@
package org.framework.lazy.cloud.network.heartbeat.common;
import io.netty.channel.Channel;
import org.wu.framework.core.utils.ObjectUtils;
import java.util.ArrayList;
import java.util.Collection;
@@ -15,94 +14,70 @@ import java.util.stream.Collectors;
public class NettyServerContext {
protected static final ConcurrentHashMap<String/*serverId*/, List<NettyClientChannel>/*NettyClientChannel*/>
protected static final ConcurrentHashMap<String/*clientId*/, List<NettyClientChannel>/*NettyClientChannel*/>
NETTY_CLIENT_CHANNEL_SOCKET = new ConcurrentHashMap<>();
/**
* 添加访客
*
* @param serverId 服务端ID
* @param clientId 客户端ID
* @param channel channel
*/
public static <T> void pushServerEndpointChannel(String serverId, String clientId, Channel channel) {
List<NettyClientChannel> nettyClientChannelList = getServerEndpointChannels(serverId);
public static <T> void pushServerEndpointChannel(String clientId, Channel channel) {
List<NettyClientChannel> nettyClientChannelList = getServerEndpointChannels(clientId);
// 关闭旧的通道
nettyClientChannelList.stream().filter(nettyClientChannel -> nettyClientChannel.getClientId().equals(clientId) && nettyClientChannel.getServerId().equals(serverId)).forEach(nettyClientChannel -> {
nettyClientChannelList.forEach(nettyClientChannel -> {
Channel oldChannel = nettyClientChannel.getChannel();
if (oldChannel != null && oldChannel.isActive()) {
oldChannel.close();
}
});
List<NettyClientChannel> activeNettyClientChannelList = nettyClientChannelList
.stream()
.filter(nettyClientChannel ->
!nettyClientChannel.getClientId().equals(clientId) && !nettyClientChannel.getServerId().equals(serverId))
nettyClientChannel.getClientId().equals(clientId) && nettyClientChannel.getChannel().isActive())
.collect(Collectors.toList());
NettyClientChannel nettyClientChannel = new NettyClientChannel(clientId, channel, serverId);
NettyClientChannel nettyClientChannel = new NettyClientChannel(clientId, channel);
activeNettyClientChannelList.add(nettyClientChannel);
NETTY_CLIENT_CHANNEL_SOCKET.put(serverId, activeNettyClientChannelList);
NETTY_CLIENT_CHANNEL_SOCKET.put(clientId, activeNettyClientChannelList);
}
/**
* 通过客户端ID获取客户端使用的访客socket
*
* @param serverId 服务端ID
* @param clientId 客户端ID
* @return 客户端通道
*/
public static List<NettyClientChannel> getServerEndpointChannels(String serverId) {
return NETTY_CLIENT_CHANNEL_SOCKET.getOrDefault(serverId, new ArrayList<>());
public static List<NettyClientChannel> getServerEndpointChannels(String clientId) {
return NETTY_CLIENT_CHANNEL_SOCKET.getOrDefault(clientId, new ArrayList<>());
}
/**
* 通过客户端ID获取客户端使用的访客socket
*
* @return 客户端通道
*/
public static List<NettyClientChannel> getServerEndpointChannels() {
return NETTY_CLIENT_CHANNEL_SOCKET
.values()
.stream()
.collect(Collectors.flatMapping(Collection::stream,Collectors.toList()));
.collect(Collectors.flatMapping(Collection::stream, Collectors.toList()));
}
/**
* 移除 客户端通道
*
* @param serverId 服务端ID
* @param clientId 客户端ID
*/
public static void removeServerEndpointChannels(String serverId) {
for (NettyClientChannel nettyClientChannel : getServerEndpointChannels(serverId)) {
public static void removeServerEndpointChannels(String clientId) {
for (NettyClientChannel nettyClientChannel : getServerEndpointChannels(clientId)) {
if (nettyClientChannel.getChannel() != null && nettyClientChannel.getChannel().isActive()) {
nettyClientChannel.getChannel().close();
}
}
NETTY_CLIENT_CHANNEL_SOCKET.remove(serverId);
}
/**
* 移除 客户端通道
*
* @param serverId 服务端ID
* @param clientId 客户端ID
*/
public static <T> void removeServerEndpointChannels(String serverId, String clientId) {
List<NettyClientChannel> nettyClientChannelList = NETTY_CLIENT_CHANNEL_SOCKET.get(serverId);
if (!ObjectUtils.isEmpty(nettyClientChannelList)) {
// 关闭指定服务端对应客户端通道
nettyClientChannelList.stream().filter(nettyClientChannel -> nettyClientChannel.getClientId().equals(clientId))
.forEach(nettyClientChannel -> {
if (nettyClientChannel.getChannel() != null && nettyClientChannel.getChannel().isActive()) {
nettyClientChannel.getChannel().close();
}
});
// 过滤后数据
List<NettyClientChannel> clientChannelList = nettyClientChannelList.stream().filter(nettyClientChannel -> !nettyClientChannel.getClientId().equals(clientId))
.collect(Collectors.toList());
NETTY_CLIENT_CHANNEL_SOCKET.put(serverId, clientChannelList);
}
NETTY_CLIENT_CHANNEL_SOCKET.remove(clientId);
}

View File

@@ -2,11 +2,18 @@ package org.framework.lazy.cloud.network.heartbeat.common.adapter;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.ChannelFlow;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.HandleChannelFlowAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate.ChannelFlow;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate.HandleChannelFlowAdvanced;
import org.framework.wu.framework.queue.Message;
import org.framework.wu.framework.queue.MessageQueue;
import org.framework.wu.framework.queue.MessageQueueFactory;
import org.springframework.boot.CommandLineRunner;
import org.wu.framework.core.utils.ObjectUtils;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* 通道流量适配器
@@ -14,16 +21,16 @@ import java.util.concurrent.*;
* @see HandleChannelFlowAdvanced
*/
@Slf4j
public class ChannelFlowAdapter {
public class ChannelFlowAdapter implements CommandLineRunner {
private static final String QUEUE_NAME = "channel_permeate_flow";
ThreadPoolExecutor CHANNEL_FLOW_ADAPTER_EXECUTOR =
new ThreadPoolExecutor(20, 200, 3L, TimeUnit.MINUTES,
new LinkedBlockingDeque<>(500),new ThreadPoolExecutor.AbortPolicy());
new ThreadPoolExecutor(10, 20, 3L, TimeUnit.MINUTES,
new LinkedBlockingDeque<>(50), new ThreadPoolExecutor.AbortPolicy());
// 线程使用完后使用主线程执行
MessageQueue queue = MessageQueueFactory.getQueue(QUEUE_NAME);
protected final List<HandleChannelFlowAdvanced> handleChannelFlowAdvancedList;
public ChannelFlowAdapter(List<HandleChannelFlowAdvanced> handleChannelFlowAdvancedList) {
@@ -54,8 +61,25 @@ public class ChannelFlowAdapter {
* @param channelFlow 通道数据
*/
public void asyncHandler(Channel channel, ChannelFlow channelFlow) {
// TODO 流量并发异常
CHANNEL_FLOW_ADAPTER_EXECUTOR.submit(() -> handler(channel, channelFlow));
// TODO 流量并发异常
Message message = new Message("channel_permeate_flow_topic", channelFlow);
// 消息发送到队列
queue.send(message);
}
@Override
public void run(String... args) throws Exception {
// 创建监听线程
Thread thread = new Thread(() -> {
while (true) {
Message receive = queue.receive();
if (ObjectUtils.isNotEmpty(receive)) {
Object body = receive.getBody();
handler(null, (ChannelFlow) body);
}
}
});
CHANNEL_FLOW_ADAPTER_EXECUTOR.submit(thread::start);
}
}

View File

@@ -2,11 +2,17 @@ package org.framework.lazy.cloud.network.heartbeat.common.adapter;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.HandleChannelFlowAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate.HandleChannelFlowAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.ChannelProxyFlow;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.HandleChannelProxyFlowAdvanced;
import org.framework.wu.framework.queue.Message;
import org.framework.wu.framework.queue.MessageQueue;
import org.framework.wu.framework.queue.MessageQueueFactory;
import org.springframework.boot.CommandLineRunner;
import org.wu.framework.core.utils.ObjectUtils;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -17,15 +23,17 @@ import java.util.concurrent.TimeUnit;
* @see HandleChannelFlowAdvanced
*/
@Slf4j
public class ChannelProxyFlowAdapter {
public class ChannelProxyFlowAdapter implements CommandLineRunner {
private static final String QUEUE_NAME = "channel_proxy_flow";
ThreadPoolExecutor CHANNEL_FLOW_ADAPTER_EXECUTOR =
new ThreadPoolExecutor(20, 200, 3L, TimeUnit.MINUTES,
new LinkedBlockingDeque<>(500),new ThreadPoolExecutor.AbortPolicy());
new ThreadPoolExecutor(10, 20, 3L, TimeUnit.MINUTES,
new LinkedBlockingDeque<>(50),new ThreadPoolExecutor.AbortPolicy());
// 线程使用完后使用主线程执行
MessageQueue queue = MessageQueueFactory.getQueue(QUEUE_NAME);
protected final List<HandleChannelProxyFlowAdvanced> handleChannelProxyFlowAdvancedList;
@@ -59,7 +67,25 @@ public class ChannelProxyFlowAdapter {
*/
public void asyncHandler(Channel channel, ChannelProxyFlow channelProxyFlow) {
// TODO 流量并发异常
CHANNEL_FLOW_ADAPTER_EXECUTOR.submit(() -> handler(channel, channelProxyFlow));
Message message = new Message("channel_proxy_flow_topic", channelProxyFlow);
// 消息发送到队列
queue.send(message);
}
@Override
public void run(String... args) throws Exception {
// 创建监听线程
Thread thread = new Thread(() -> {
while (true) {
Message receive = queue.receive();
if(ObjectUtils.isNotEmpty(receive)) {
Object body = receive.getBody();
handler(null, (ChannelProxyFlow) body);
}
}
});
CHANNEL_FLOW_ADAPTER_EXECUTOR.submit(thread::start);
}
}

View File

@@ -2,9 +2,9 @@ package org.framework.lazy.cloud.network.heartbeat.common.advanced;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.NettyChannelContext;
import org.springframework.core.Ordered;
import org.framework.lazy.cloud.network.heartbeat.common.constant.TcpMessageType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;
import org.springframework.core.Ordered;
/**
* 通道不同数据类型处理器

View File

@@ -1,4 +1,4 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow;
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate;
import io.netty.channel.Channel;

View File

@@ -1,4 +1,4 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow;
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate;
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;

View File

@@ -1,4 +1,4 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow;
package org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.permeate;
import io.netty.channel.Channel;

View File

@@ -15,7 +15,7 @@ import java.nio.charset.StandardCharsets;
@Setter
@Getter
public class NettyProxyMsg {
// body 长度 type 1 isSsl 1 appKey 4 appSecret 4 clientId 4 originalIp 4 clientTargetIp 4 clientTargetPort 4 visitorPort 4 visitorId 4 data 4
// body 长度 type 1 isSsl 1 appKey 4 appSecret 4 clientId 4 originalIp 4 targetIp 4 targetPort 4 visitorPort 4 visitorId 4 data 4
public static final int bodyLength = 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
@@ -55,6 +55,7 @@ public class NettyProxyMsg {
* @since 1.2.9
*/
private byte[] originalIp;
/**
* 客户端ID
* byte[] 长度 4
@@ -64,13 +65,13 @@ public class NettyProxyMsg {
* 客户端目标地址
* byte[] 长度 4
*/
private byte[] clientTargetIp;
private byte[] targetIp;
/**
* 客户端目标端口
* byte[] 长度 4
*/
private byte[] clientTargetPort;
private byte[] targetPort;
/**
* 客户端目使用的代理端口
* byte[] 长度 4
@@ -92,8 +93,8 @@ public class NettyProxyMsg {
public String toString() {
return "NettyProxyMsg [type=" + type +
",clientId=" + (clientId == null ? null : new String(clientId)) +
",clientTargetIp=" + (clientTargetIp == null ? null : new String(clientTargetIp)) +
",clientTargetPort=" + (clientTargetPort == null ? null : new String(clientTargetPort)) +
",targetIp=" + (targetIp == null ? null : new String(targetIp)) +
",targetPort=" + (targetPort == null ? null : new String(targetPort)) +
",visitorPort=" + (visitorPort == null ? null : new String(visitorPort)) +
"]";
}
@@ -107,6 +108,8 @@ public class NettyProxyMsg {
}
public void setAppKeyString(String appKey) {
if (ObjectUtils.isEmpty(appKey)) {
this.appKey = null;
@@ -172,40 +175,42 @@ public class NettyProxyMsg {
return new String(originalIp, StandardCharsets.UTF_8);
}
public String getClientIdString() {
public String clientId() {
if (ObjectUtils.isEmpty(clientId)) {
return null;
}
return new String(clientId, StandardCharsets.UTF_8);
}
/**
* 客户端目标地址
*
* @return 客户端目标地址
*/
public String getTargetIpString() {
if (ObjectUtils.isEmpty(clientTargetIp)) {
public String targetIp() {
if (ObjectUtils.isEmpty(targetIp)) {
return null;
}
return new String(clientTargetIp, StandardCharsets.UTF_8);
return new String(targetIp, StandardCharsets.UTF_8);
}
/**
* 客户端目标端口
*
* @return 客户端目标端口
*/
public String getTargetPortString() {
if (ObjectUtils.isEmpty(clientTargetPort)) {
public String targetPort() {
if (ObjectUtils.isEmpty(targetPort)) {
return null;
}
return new String(clientTargetPort, StandardCharsets.UTF_8);
return new String(targetPort, StandardCharsets.UTF_8);
}
/**
* 获取访客ID
* @return
*/
public String getVisitorIdString() {
public String visitorId() {
if (ObjectUtils.isEmpty(visitorId)) {
return null;
}
@@ -219,20 +224,20 @@ public class NettyProxyMsg {
return Integer.valueOf(new String(visitorPort, StandardCharsets.UTF_8));
}
public void setClientTargetIp(byte[] clientTargetIp) {
this.clientTargetIp = clientTargetIp;
public void setTargetIp(byte[] targetIp) {
this.targetIp = targetIp;
}
public void setClientTargetIp(String clientTargetIp) {
this.clientTargetIp = clientTargetIp.getBytes(StandardCharsets.UTF_8);
public void setTargetIp(String clientTargetIp) {
this.targetIp = clientTargetIp.getBytes(StandardCharsets.UTF_8);
}
public void setClientTargetPort(Integer clientTargetPort) {
this.clientTargetPort = String.valueOf(clientTargetPort).getBytes(StandardCharsets.UTF_8);
public void setTargetPort(Integer targetPort) {
this.targetPort = String.valueOf(targetPort).getBytes(StandardCharsets.UTF_8);
}
public void setClientTargetPort(byte[] clientTargetPort) {
this.clientTargetPort = clientTargetPort;
public void setTargetPort(byte[] targetPort) {
this.targetPort = targetPort;
}
public void setVisitorPort(byte[] visitorPort) {

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;
/**

View File

@@ -1,9 +1,9 @@
package org.framework.lazy.cloud.network.heartbeat.common.advanced.permeate.tcp.client;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.payload.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.advanced.payload.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.enums.TcpMessageTypeEnums;

Some files were not shown because too many files have changed in this diff Show More