https://github.com/whz11/qynat-spring-boot-starter
A springboot-starter that can achieve Intranet penetration. 一款可以实现内网穿透的springboot-starter。
https://github.com/whz11/qynat-spring-boot-starter
java nat netty spring-boot-starter springboot
Last synced: 2 days ago
JSON representation
A springboot-starter that can achieve Intranet penetration. 一款可以实现内网穿透的springboot-starter。
- Host: GitHub
- URL: https://github.com/whz11/qynat-spring-boot-starter
- Owner: whz11
- License: mit
- Created: 2021-07-25T13:18:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-29T15:03:45.000Z (about 5 years ago)
- Last Synced: 2023-03-04T06:56:40.349Z (over 3 years ago)
- Topics: java, nat, netty, spring-boot-starter, springboot
- Language: Java
- Homepage:
- Size: 5.61 MB
- Stars: 66
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - QyNat Spring Boot Starter
README
# qynat-springboot-starter
[](https://github.com/whz11/qynat-spring-boot-starter/)
[](https://developers.google.cn/protocol-buffers?hl=zh-cn)
[](https://github.com/whz11/qynat-spring-boot-starter/blob/master/LICENSE)
[](https://jitpack.io/#whz11/qynat-spring-boot-starter)
基于netty的内网穿透工具在springboot中的整合
protocol协议:[protobuf](https://developers.google.cn/protocol-buffers?hl=zh-cn)
只需在`application.properties`中配置少量信息,实现零代码侵入的web项目内网穿透
项目的server端的源码在另一个多模块项目中,包括client端的命令行版、GUI版,还没写好readme暂时先不贴链接
## Table of Contents
- [QuickStart](https://github.com/whz11/qynat-spring-boot-starter/blob/master/README.md#QuickStart)
- [Maintainers](https://github.com/whz11/qynat-spring-boot-starter/blob/master/README.md#maintainers)
- [License](https://github.com/whz11/qynat-spring-boot-starter/blob/master/README.md#license)
## QuickStart
### 服务端配置
在项目的lib包下有个`server.jar`,将他部署在可外网访问的服务器上,输入命令(需在jdk环境下):
```
java -jar server.jar -p -t
```
看到以下,说明服务端成功运行
```
QyNat server started on port xxxx
```
### 客户端配置
#### 引入依赖
* maven项目在pom中引入
```xml
com.github.whz11
qynat-spring-boot-starter
Tag
jitpack.io
https://jitpack.io
```
* gradle项目
```properties
dependencies {
implementation 'com.github.whz11:qynat-spring-boot-starter:Tag'
}
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
#### 配置application.properties
```properties
##server端部署地址
qynat.server-address=xxx.xxx.xxx.xxx
##server端部署端口号
qynat.server-port=7777
##server端配置令牌(可空)
qynat.token=123456
##本机地址(不填自动获取ip地址)
qynat.proxy-address=localhost
##本机端口(不填自动默认采用项目的server.port)
qynat.proxy-port=8080
##映射端口
qynat.remote-port=8080
```
解释:服务运行后,本机地址可以通过`server-address:remote-port`访问
#### 客户端最后一步
在启动类中加上`@EnabledQyNat`注解
```java
@SpringBootApplication
@EnabledQyNat
public class StarterDemoApplication {
public static void main(String[] args) {
SpringApplication.run(StarterDemoApplication.class, args);
}
}
```
在控制台看到以下,说明客户端启动成功
```
Started QyNatClient success mapping at:http://server-address:remote-port
Register to qynat
```
## Maintainers
[@whz11](https://github.com/whz11/).
## Contributing
Feel free to dive in! [Open an issue](https://github.com/whz11/qynat-spring-boot-starter/issues/new) or submit PRs.
## License
[MIT](https://github.com/whz11/qynat-springboot-starter/blob/master/LICENSE) © whz11