Module io.inverno.mod.http.server


module io.inverno.mod.http.server

The Inverno framework HTTP server module provides a HTTP1.x and HTTP/2 server.

It defines the following sockets:

httpServerConfiguration
the HTTP server module configuration
netService (required)
the Net service used to create the HTTP server
resourceService (required)
the resource service used to load resources required by the HTTP server (eg. key store...)
controller
override the default HTTP server controller used to process server exchanges
headerCodecs
custom header codecs
parameterConverter
override the default parameter converter used in Parameter instances to convert their values

It exposes the following beans:

httpServerConfiguration
the HTTP server module configuration
controller
the HTTP server controller

A simple HTTP server using the default configuration can be started as follows:


 NetService netService = ...;
 ResourceService resourceService = ...;

 Application.with(new Server.Builder(netService, resourceService)
     .setHttpServerConfiguration(HttpServerConfigurationLoader.load(conf -> conf.server_port(8080)))
     .setController(ServerController.from(
         exchange -> exchange
             .response()
             .body()
             .raw()
             .value(Unpooled.unreleasableBuffer(Unpooled.copiedBuffer("Hello, world!", Charsets.DEFAULT)))
      ))
 ).run();
 
Since:
1.0
Author:
Jeremy Kuhn