HttpServer

Types

Link copied to clipboard
abstract class BaseRequest(val uri: String, val headers: Http.Headers) : Extra
Link copied to clipboard
object Companion
Link copied to clipboard
abstract class Request(val method: Http.Method, val uri: String, val headers: Http.Headers, val requestConfig: HttpServer.RequestConfig = RequestConfig()) : HttpServer.BaseRequest, AsyncOutputStream
Link copied to clipboard
data class RequestConfig(val beforeSendHeadersInterceptors: MutableMap<String, suspend (HttpServer.Request) -> Unit> = LinkedHashMap()) : Extra
Link copied to clipboard
abstract class WsRequest(val uri: String, val headers: Http.Headers, val scope: CoroutineScope) : HttpServer.BaseRequest

Properties

Link copied to clipboard
open val actualHost: String
Link copied to clipboard
open val actualPort: Int
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun allHandler(handler: suspend (HttpServer.BaseRequest) -> Unit): HttpServer
Link copied to clipboard
suspend override fun close()
Link copied to clipboard
suspend fun errorHandler(handler: suspend (Throwable) -> Unit): HttpServer
Link copied to clipboard
suspend fun httpHandler(handler: suspend (HttpServer.Request) -> Unit): HttpServer
Link copied to clipboard
suspend fun listen(port: Int = 0, host: String = "127.0.0.1"): HttpServer
suspend fun listen(port: Int = 0, host: String = "127.0.0.1", handler: suspend (HttpServer.Request) -> Unit): HttpServer
Link copied to clipboard
inline suspend fun HttpServer.router(block: HttpServerRouter.() -> Unit)
Link copied to clipboard
suspend fun websocketHandler(handler: suspend (HttpServer.WsRequest) -> Unit): HttpServer