An open API service indexing awesome lists of open source software.

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。

Awesome Lists containing this project

README

          

# qynat-springboot-starter

[![](https://img.shields.io/static/v1?label=qynat&message=springboot&color=important)](https://github.com/whz11/qynat-spring-boot-starter/)
[![](https://img.shields.io/static/v1?label=protocol&message=protobuf&color=ff69b4)](https://developers.google.cn/protocol-buffers?hl=zh-cn)
[![](https://img.shields.io/static/v1?label=license&message=MIT&color=informational)](https://github.com/whz11/qynat-spring-boot-starter/blob/master/LICENSE)
[![](https://jitpack.io/v/whz11/qynat-spring-boot-starter.svg)](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