Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.43 KB

README.md

File metadata and controls

50 lines (41 loc) · 1.43 KB

ESA HttpServer

Build codecov Maven Central GitHub license

ESA HttpServer is an asynchronous event-driven http server based on netty.

Features

  • Asynchronous request handing
  • Http1/H2/H2cUpgrade
  • Https
  • HAProxy
  • Epoll/NIO
  • Chunked read/write
  • Body aggregation
  • Multipart
  • Metrics
  • more features...

Maven Dependency

<dependency>
    <groupId>com.github.esastack</groupId>
    <artifactId>httpserver</artifactId>
    <version>${esa-httpserver.version}</version>
</dependency>

Quick Start

HttpServer.create()
        .handle(req -> {
            req.onData(buf -> {
                // handle http content 
            });
            req.onEnd(p -> {
                req.response()
                        .setStatus(200)
                        .end("Hello ESA Http Server!".getBytes());
                return p.setSuccess(null);
            });
        })
        .listen(8080);