【fix】readme.md

This commit is contained in:
wujiawei 2024-01-30 12:34:17 +08:00
parent a307fce768
commit d299759ed4
11 changed files with 87 additions and 9 deletions

View File

@ -1,17 +1,95 @@
原理分析 内网穿透的实现过程主要分三步
1、启动服务端这时服务端监听了两个端口1600116002可根据启动参数修改
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=wu-lazy-cloud-network%20wu-lazy-cloud-network">
<img src="https://img.shields.io/nexus/s/top.wu2020/wu-lazy-cloud-network?server=https%3A%2F%2Foss.sonatype.org&style=flat&logo=log" alt="Maven" />
</a>
<a target="_blank" href="https://search.maven.org/search?q=wu-lazy-cloud-network%20wu-lazy-cloud-network">
<img src="https://img.shields.io/maven-central/v/top.wu2020/wu-lazy-cloud-network" alt="Maven" />
</a>
<a target="_blank" href="https://www.apache.org/licenses/LICENSE-2.0.txt">
<img src="https://img.shields.io/:license-Apache2-blue.svg" alt="Apache 2" />
</a>
<a target="_blank" href="https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html">
<img src="https://img.shields.io/badge/JDK-11-green.svg" alt="jdk-11" />
</a>
<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>
<br />
<img src="https://img.shields.io/badge/SpringBoot-v3.x-blue">
<br />
<a target="_blank" href='https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network'>
<img src='https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network/badge/star.svg' alt='Gitee star'/>
</a>
一个用来接收客户端请求16001端口
</p>
一个用来接收访客代理16002端口
#### 项目介绍
wu-lazy-cloud-network 是一款基于wu-framework-parent孵化出的项目内部使用Lazy ORM操作数据库主要功能是网络穿透对于没有公网IP的服务进行公网IP映射
使用环境JDK17 Spring Boot 3.0.2
2、启动客户端客户端访问服务端提供的16001端口建立连接server-client通道
3、访客访问代理接口16002端口服务端监听到之后创建访客ID然后通过server-client通道向客户端发送指令客户端接收指令后连接到真实服务端口8080可根据启动参数修改连接真实服务成功后客户端会重新向服务端建立一条连接访客-server通道服务端把访客和该通道进行绑定
### 项目结构
这三步最终形成了(访客-代理-客户端-真实服务)完整的通道。
| 模块 | 版本 | 描述 |
|---------------------------------------------------------------------------------------------------------------|----------------------|------------------------------|
| [wu-lazy-cloud-heartbeat-common](wu-lazy-cloud-heartbeat-common) | 1.2.2-JDK17-SNAPSHOT | 内网穿透公共模块(声明接口、枚举、常量、适配器、解析器) |
| [wu-lazy-cloud-heartbeat-client](wu-lazy-cloud-heartbeat-client) | 1.2.2-JDK17-SNAPSHOT | 客户端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-server](wu-lazy-cloud-heartbeat-server) | 1.2.2-JDK17-SNAPSHOT | 服务端(支持二次开发) |
| [wu-lazy-cloud-network-ui](wu-lazy-cloud-network-ui) | 1.2.2-JDK17-SNAPSHOT | 服务端页面 |
| [wu-lazy-cloud-heartbeat-client-sample](wu-lazy-cloud-heartbeat-sample/wu-lazy-cloud-heartbeat-client-sample) | 1.2.2-JDK17-SNAPSHOT | 客户端样例 |
| [wu-lazy-cloud-heartbeat-server-sample](wu-lazy-cloud-heartbeat-sample/wu-lazy-cloud-heartbeat-server-sample) | 1.2.2-JDK17-SNAPSHOT | 服务端样例 |
启动服务端 java -jar cc-server.jar 16001 16002
启动客户端 java -jar cc-client.jar 127.0.0.1 16001 8080
### 使用技术
| 框架 | 版本 | 描述 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|--------------|
| spring-boot | 3.0.7 | springboot框架 |
| [wu-framework-web](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-framework-web) | 1.2.2-JDK17-SNAPSHOT | web容器 |
| [Lazy -ORM](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-inner-intergration/wu-database-parent) | 1.2.2-JDK17-SNAPSHOT | 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.2.2-JDK17-SNAPSHOT | 用户授权体系 |
### 使用环境
IDEA
Mac、Windows
JAVA >=13
MAVEN
### 启动
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.2.2-JDK17-SNAPSHOT
http://127.0.0.1:18080/swagger-ui/index.html
源码启动
#### 页面操作
启动项目后打开服务端界面
![img.png](url_info.png)
默认账号密码admin/admin
![img.png](login.png)
初始化项目
![img.png](init_menu.png)
添加角色
![img.png](init_role.png)
为用户授权
![img.png](authRoe2User.png)
刷新页面
![img.png](main.png)
客户端管理
![img.png](cloud_client.png)
网络映射管理
![img.png](mapping.png)
访客端口开发管理
![img.png](visitor_port.png)
客户端代理流量管理
![img.png](flow.png)

BIN
authRoe2User.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
cloud_client.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
init_menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
init_role.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
login.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

BIN
main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
mapping.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
url_info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

BIN
visitor_port.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB