Skip to content

esastack/esa-httpserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);