Scoop API

scoop:scoop.http.server:0.1.0

HttpServerOptions

class HttpServerOptions

source · line 8
public
public class HttpServerOptions internal constructor(
    /** Shared TLS configuration, retained by the caller; None selects cleartext. */
    public val tls: TlsServerContext? = None,
    /** Whether TLS without negotiated ALPN may use HTTP/1. */
    public val allowHttp1Fallback: Boolean = true,
    /** Whether cleartext connections may select HTTP/2 prior knowledge by their preface. */
    public val allowCleartextHttp2: Boolean = false,
    /** Whether TLS connections may select h2 through ALPN. */
    public val allowTlsHttp2: Boolean = true,
    /** Maximum owned TCP connections, including handshakes and idle keep-alive connections. */
    public val maxConnections: Long = 1024L,
    /** Maximum concurrent application requests, including response execution and cleanup. */
    public val maxActiveRequests: Long = 256L,
    /** Maximum reserved or active upgraded sessions, held until their cleanup ends. */
    public val maxWebSocketSessions: Long = maxConnections,
    /** Shared application-request limits, lifetime and completion observation. */
    public val request: HttpRequestOptions = httpRequestOptions(),
    /** Total TLS handshake time, or None to disable this deadline. */
    public val tlsHandshakeTimeout: Duration? = Some(Duration.seconds(10)),
    /** Total time to receive the first complete request head, including cleartext probing. */
    public val firstRequestHeadTimeout: Duration? = Some(Duration.seconds(10)),
    /** Total time for each recognized initial HTTP/2 HEADERS block, including CONTINUATION. */
    public val http2HeadTimeout: Duration? = Some(Duration.seconds(10)),
    /** Idle connection limit; HTTP/1 includes the next head, HTTP/2 excludes active requests. */
    public val keepAliveIdleTimeout: Duration? = Some(Duration.seconds(60)),
    /** Read stagnation limit applied by the HTTP transport to request input. */
    public val bodyReadIdle: Duration? = Some(Duration.seconds(30)),
    /** Write stagnation limit applied by the HTTP transport to response output. */
    public val responseWriteIdle: Duration? = Some(Duration.seconds(30)),
    /** Default natural-drain period before forced cancellation and cleanup. */
    public val gracefulShutdownTimeout: Duration = Duration.seconds(30),
    /** HTTP/1 receive behavior; strict defaults are preserved. */
    public val http1Receive: Http1ReceiveOptions = Http1ReceiveOptions(),
    /** Existing HTTP/1 start-line, field and buffering limits. */
    public val http1Limits: Http1Limits = Http1Limits(),
    /** HTTP/2 receive behavior, rejecting invalid regular fields by default. */
    public val http2Receive: Http2ReceiveOptions =
        Http2ReceiveOptions(invalidRegularField = Http2InvalidRegularField.RejectStream),
    /** Existing HTTP/2 header and pending output limits. */
    public val http2Limits: Http2Limits = Http2Limits(),
    /** Local HTTP/2 settings, including the bounded incoming request queue. */
    public val http2Settings: Http2Settings = Http2Settings(),
    /** Observes an upgraded session only after business work and transport cleanup have ended. */
    public val onWebSocketCompleted: ((HttpWebSocketCompletion) -> Unit)? = None,
    /** Observes isolated connection failures without controlling another connection. */
    public val onConnectionError: ((HttpConnectionInfo, Throwable) -> Unit)? = None
)

Transport, capacity and timeout configuration for an owned HTTP server.

Extensions

property responseWriteIdle

source · line 36
public
public val responseWriteIdle: Duration? = Some(Duration.seconds(30))

get: public read-only

Write stagnation limit applied by the HTTP transport to response output.

property tls

source · line 10
public
public val tls: TlsServerContext? = None

get: public read-only

Shared TLS configuration, retained by the caller; None selects cleartext.

property http2Settings

source · line 49
public
public val http2Settings: Http2Settings = Http2Settings()

get: public read-only

Local HTTP/2 settings, including the bounded incoming request queue.

property allowHttp1Fallback

source · line 12
public
public val allowHttp1Fallback: Boolean = true

get: public read-only

Whether TLS without negotiated ALPN may use HTTP/1.

property maxWebSocketSessions

source · line 22
public
public val maxWebSocketSessions: Long = maxConnections

get: public read-only

Maximum reserved or active upgraded sessions, held until their cleanup ends.

property http2HeadTimeout

source · line 30
public
public val http2HeadTimeout: Duration? = Some(Duration.seconds(10))

get: public read-only

Total time for each recognized initial HTTP/2 HEADERS block, including CONTINUATION.

property http1Limits

source · line 42
public
public val http1Limits: Http1Limits = Http1Limits()

get: public read-only

Existing HTTP/1 start-line, field and buffering limits.

property http1Receive

source · line 40
public
public val http1Receive: Http1ReceiveOptions = Http1ReceiveOptions()

get: public read-only

HTTP/1 receive behavior; strict defaults are preserved.

property bodyReadIdle

source · line 34
public
public val bodyReadIdle: Duration? = Some(Duration.seconds(30))

get: public read-only

Read stagnation limit applied by the HTTP transport to request input.

property allowTlsHttp2

source · line 16
public
public val allowTlsHttp2: Boolean = true

get: public read-only

Whether TLS connections may select h2 through ALPN.

property maxActiveRequests

source · line 20
public
public val maxActiveRequests: Long = 256L

get: public read-only

Maximum concurrent application requests, including response execution and cleanup.

property allowCleartextHttp2

source · line 14
public
public val allowCleartextHttp2: Boolean = false

get: public read-only

Whether cleartext connections may select HTTP/2 prior knowledge by their preface.

property http2Limits

source · line 47
public
public val http2Limits: Http2Limits = Http2Limits()

get: public read-only

Existing HTTP/2 header and pending output limits.

property tlsHandshakeTimeout

source · line 26
public
public val tlsHandshakeTimeout: Duration? = Some(Duration.seconds(10))

get: public read-only

Total TLS handshake time, or None to disable this deadline.

property firstRequestHeadTimeout

source · line 28
public
public val firstRequestHeadTimeout: Duration? = Some(Duration.seconds(10))

get: public read-only

Total time to receive the first complete request head, including cleartext probing.

property maxConnections

source · line 18
public
public val maxConnections: Long = 1024L

get: public read-only

Maximum owned TCP connections, including handshakes and idle keep-alive connections.

property gracefulShutdownTimeout

source · line 38
public
public val gracefulShutdownTimeout: Duration = Duration.seconds(30)

get: public read-only

Default natural-drain period before forced cancellation and cleanup.

property request

source · line 24
public
public val request: HttpRequestOptions = httpRequestOptions()

get: public read-only

Shared application-request limits, lifetime and completion observation.

property onWebSocketCompleted

source · line 51
public
public val onWebSocketCompleted: ((HttpWebSocketCompletion) -> Unit)? = None

get: public read-only

Observes an upgraded session only after business work and transport cleanup have ended.

property keepAliveIdleTimeout

source · line 32
public
public val keepAliveIdleTimeout: Duration? = Some(Duration.seconds(60))

get: public read-only

Idle connection limit; HTTP/1 includes the next head, HTTP/2 excludes active requests.