Skip to content
forked from fzdwx/sky

⚡ 快速基于Netty创建出你自己的服务(HTTP,Weboscket,TCP...) quickly create an http service or websocket service.(lightweight high-performance maybe?)

License

Notifications You must be signed in to change notification settings

DesignerLookMe/sky

 
 

Repository files navigation

Sky | Netty Based Transport Tool Kit.

🚀 Use sky you can quickly create an http service or websocket service

Features

  • Http Server
  • Websocket Server
  • Spring boot starter in development (已经基本可用)
  • 😙give me some issue!

Showcase

<dependency>
  <groupId>io.github.fzdwx</groupId>
  <artifactId>sky-http-springboot-starter</artifactId>
  <version>0.10.6</version>
</dependency>
import http.HttpServerRequest;

@SpringBootApplication
@RestController
public class BurstServerApplication {

    public static void main(String[] args) {
        final ConfigurableApplicationContext run = SpringApplication.run(BurstServerApplication.class);
    }

    // normal request
    @GetMapping("hello")
    public String hello(@RequestParam String name) {
        return "Hello " + name;
    }

    // upgrade to websocket
    @GetMapping("connect")
    public void connect(@RequestParam String name, HttpServerRequest request) {
        request.upgradeToWebSocket(ws->{
            ws.mountOpen(h -> {
                ws.send("Hello " + name);
            });
        });
    }
}

About

⚡ 快速基于Netty创建出你自己的服务(HTTP,Weboscket,TCP...) quickly create an http service or websocket service.(lightweight high-performance maybe?)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%