Git Product home page Git Product logo

qynat-spring-boot-starter's Introduction

qynat-springboot-starter

基于netty的内网穿透工具在springboot中的整合

protocol协议:protobuf

只需在application.properties中配置少量信息,实现零代码侵入的web项目内网穿透

项目的server端的源码在另一个多模块项目中,包括client端的命令行版、GUI版,还没写好readme暂时先不贴链接

Table of Contents

QuickStart

服务端配置

在项目的lib包下有个server.jar,将他部署在可外网访问的服务器上,输入命令(需在jdk环境下):

java -jar server.jar -p <server-port> -t <token>

看到以下,说明服务端成功运行

QyNat server started on port xxxx

客户端配置

引入依赖

  • maven项目在pom中引入
    <dependencies>      
        <dependency>
            <groupId>com.github.whz11</groupId>
            <artifactId>qynat-spring-boot-starter</artifactId>
            <version>Tag</version><!--见上方jitpack后面的版本-->
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
 
  • gradle项目
	dependencies {
	        implementation 'com.github.whz11:qynat-spring-boot-starter:Tag'
	}
	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

配置application.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注解

@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.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © whz11

qynat-spring-boot-starter's People

Contributors

whz11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qynat-spring-boot-starter's Issues

to which file.jar add:

to which file.jar add:
@SpringBootApplication
@EnabledQyNat
public class StarterDemoApplication {

public static void main(String[] args) {
    SpringApplication.run(StarterDemoApplication.class, args);
}

}
?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.