Package com.hexagonkt.http.server

This package defines server interfaces for HTTP server adapters.

Types

Link copied to clipboard
data class HttpServer(    adapter: HttpServerPort,     val handlers: List<ServerHandler>,     val settings: HttpServerSettings = HttpServerSettings()) : Closeable

Server that listen to HTTP connections on a port and address and route requests to handlers.

Link copied to clipboard
enum HttpServerFeature : Enum<HttpServerFeature>

Toolkit feature that may or may not be implemented by a server adapter.

Link copied to clipboard
interface HttpServerPort

Server instance of one kind.

Link copied to clipboard
data class HttpServerSettings(    val bindAddress: InetAddress = InetAddress.getLoopbackAddress(),     val bindPort: Int = 2010,     val contextPath: String = "",     val protocol: HttpProtocol = HTTP,     val sslSettings: SslSettings? = null,     val banner: String? = null,     val features: Set<HttpServerFeature> = emptySet())

Holds server settings info.

Functions

Link copied to clipboard
fun serve(    adapter: HttpServerPort,     settings: HttpServerSettings = HttpServerSettings(),     block: ServerBuilder.() -> Unit): HttpServer
fun serve(    adapter: HttpServerPort,     handler: ServerHandler,     settings: HttpServerSettings = HttpServerSettings()): HttpServer
fun serve(    adapter: HttpServerPort,     handlers: List<ServerHandler>,     settings: HttpServerSettings = HttpServerSettings()): HttpServer

Create a server and start it.