This commit is contained in:
wujiawei 2024-10-07 22:34:40 +08:00
parent 67c2537823
commit 0dd5b986a2
5 changed files with 33 additions and 23 deletions

10
ClientPermeateClient.md Normal file
View File

@ -0,0 +1,10 @@
### 背景:国庆期间的问题,如何在老家访问杭州办公室的网络呢
#### 实现方案:异地组网
#### 实现语言Java
#### 环境三个网络一台拥有公网IP的服务器、一台杭州本地机房内服务器、你老家所在网络中的一台电脑用你自己的就好了
#### 实现原理:![NetworkPermeateClientPermeateClient.png](NetworkPermeateClientPermeateClient.png)
#### 操作步骤拥有公网ip的服务器开发6001web、7001端口tcp然后执行命令启动服务端
#### 操作步骤:

View File

@ -260,21 +260,21 @@ public class NettyClientSocket {
| 模块 | 版本 | 描述 | | 模块 | 版本 | 描述 |
|------------------------------------------------------------------------------------------------------------|----------------------|------------------------------| |------------------------------------------------------------------------------------------------------------|----------------------|------------------------------|
| [wu-lazy-cloud-heartbeat-common](wu-lazy-cloud-heartbeat-common) | 1.2.8-JDK17-SNAPSHOT | 内网穿透公共模块(声明接口、枚举、常量、适配器、解析器) | | [wu-lazy-cloud-heartbeat-common](wu-lazy-cloud-heartbeat-common) | 1.2.9-JDK17-SNAPSHOT | 内网穿透公共模块(声明接口、枚举、常量、适配器、解析器) |
| [wu-lazy-cloud-heartbeat-client](wu-lazy-cloud-heartbeat-client) | 1.2.8-JDK17-SNAPSHOT | 客户端(支持二次开发) | | [wu-lazy-cloud-heartbeat-client](wu-lazy-cloud-heartbeat-client) | 1.2.9-JDK17-SNAPSHOT | 客户端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-server](wu-lazy-cloud-heartbeat-server) | 1.2.8-JDK17-SNAPSHOT | 服务端(支持二次开发) | | [wu-lazy-cloud-heartbeat-server](wu-lazy-cloud-heartbeat-server) | 1.2.9-JDK17-SNAPSHOT | 服务端(支持二次开发) |
| [wu-lazy-cloud-heartbeat-client-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start) | 1.2.8-JDK17-SNAPSHOT | 客户端样例 | | [wu-lazy-cloud-heartbeat-client-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-server-start) | 1.2.9-JDK17-SNAPSHOT | 客户端样例 |
| [wu-lazy-cloud-heartbeat-server-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start) | 1.2.8-JDK17-SNAPSHOT | 服务端样例 | | [wu-lazy-cloud-heartbeat-server-start](wu-lazy-cloud-heartbeat-start/wu-lazy-cloud-heartbeat-client-start) | 1.2.9-JDK17-SNAPSHOT | 服务端样例 |
### 使用技术 ### 使用技术
| 框架 | 版本 | 描述 | | 框架 | 版本 | 描述 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|--------------| |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|--------------|
| spring-boot | 3.0.7 | springboot框架 | | spring-boot | 3.0.7 | springboot框架 |
| [wu-framework-web](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-framework-web) | 1.2.8-JDK17-SNAPSHOT | web容器 | | [wu-framework-web](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-framework-web) | 1.2.9-JDK17-SNAPSHOT | web容器 |
| [Lazy -ORM](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-inner-intergration/wu-database-parent) | 1.2.8-JDK17-SNAPSHOT | ORM | | [Lazy -ORM](https://gitee.com/wujiawei1207537021/wu-framework-parent/tree/master/wu-inner-intergration/wu-database-parent) | 1.2.9-JDK17-SNAPSHOT | ORM |
| mysql-connector-j | 8.0.33 | mysql驱动 | | 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.8-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.2.9-JDK17-SNAPSHOT | 用户授权体系 |
### 使用环境 ### 使用环境
@ -287,7 +287,7 @@ public class NettyClientSocket {
docker启动 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.8-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.2.9-JDK17-SNAPSHOT
http://127.0.0.1:18080/swagger-ui/index.html http://127.0.0.1:18080/swagger-ui/index.html

View File

@ -9,9 +9,9 @@ mvn clean package -Pnative
```shell ```shell
mvn spring-boot:build-image -Pnative mvn spring-boot:build-image -Pnative
docker tag docker.io/library/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-NATIVE-SNAPSHOT docker tag docker.io/library/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-NATIVE-SNAPSHOT
docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-NATIVE-SNAPSHOT docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-NATIVE-SNAPSHOT
``` ```
@ -24,8 +24,8 @@ docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-cl
mvn clean install mvn clean install
docker build -t registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT . docker build -t registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT .
docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT
``` ```
@ -33,12 +33,12 @@ docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-cl
### run ### run
```shell ```shell
docker run -d -it --privileged --name client -p 6004:6004 registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT docker run -d -it --privileged --name client -p 6004:6004 registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT
``` ```
```shell ```shell
docker run -d -it --privileged --name client --restart=always -e spring.lazy.netty.client.inet-host=124.222.48.62 -e spring.lazy.netty.client.inet-port=30676 -e spring.lazy.netty.client.client-id="shihua" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT docker run -d -it --privileged --name client --restart=always -e spring.lazy.netty.client.inet-host=124.222.48.62 -e spring.lazy.netty.client.inet-port=30676 -e spring.lazy.netty.client.client-id="shihua" registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT
``` ```
```yaml ```yaml
@ -73,7 +73,7 @@ kubeadm join apiserver.demo:6443 --token 2wtcsg.0af26p9wzfgvyf5a --discovery
``` ```
```RUN ```RUN
docker run -d -it --name client registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.8-JDK17-SNAPSHOT docker run -d -it --name client registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.2.9-JDK17-SNAPSHOT
http://127.0.0.1:18080 http://127.0.0.1:18080

View File

@ -11,9 +11,9 @@ mvn clean package -Pnative
```shell ```shell
mvn spring-boot:build-image -Pnative mvn spring-boot:build-image -Pnative
docker tag docker.io/library/wu-lazy-cloud-heartbeat-server-start:1.2.8-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.8-JDK17-NATIVE-SNAPSHOT docker tag docker.io/library/wu-lazy-cloud-heartbeat-server-start:1.2.9-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.9-JDK17-NATIVE-SNAPSHOT
docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.8-JDK17-NATIVE-SNAPSHOT docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.9-JDK17-NATIVE-SNAPSHOT
``` ```
@ -23,14 +23,14 @@ docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-se
mvn clean install mvn clean install
docker build -t registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.8-JDK17-SNAPSHOT . docker build -t registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.9-JDK17-SNAPSHOT .
docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.8-JDK17-SNAPSHOT docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.9-JDK17-SNAPSHOT
``` ```
```RUN ```RUN
docker run -d -it -p 6001:6001 --name wu-lazy-cloud-heartbeat-server-start registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-server-start:1.2.7-JDK17-NATIVE-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.2.9-JDK17-NATIVE-SNAPSHOT
http://127.0.0.1:6001/swagger-ui/index.html http://127.0.0.1:6001/swagger-ui/index.html

View File

@ -1,8 +1,8 @@
spring: spring:
datasource: datasource:
url: jdbc:mysql://${MAIN_DB_HOST}/wu_lazy_cloud_netty_server?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useAffectedRows=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&databaseTerm=SCHEMA url: jdbc:mysql://${MAIN_DB_HOST}/wu_lazy_cloud_netty_server?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useAffectedRows=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&databaseTerm=SCHEMA
username: root username: ${MAIN_DB_USER_NAME:root}
password: wujiawei password: ${MAIN_DB_PASSWORD:wujiawei}
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true