Skip to content

ServerConfig

[Source]

Server-level configuration.

Host and port specify the listen address. Parser limits control the maximum size of request components. Idle timeout controls how long a keep-alive connection can sit without activity before being closed.

// All defaults (60-second idle timeout)
ServerConfig("localhost", "8080")

// Custom timeout via MakeIdleTimeout (milliseconds)
let timeout = match lori.MakeIdleTimeout(30_000)
| let t: lori.IdleTimeout => t
end
ServerConfig("0.0.0.0", "80" where
  max_body_size' = 10_485_760,  // 10 MB
  idle_timeout' = timeout)

// Disable idle timeout
ServerConfig("0.0.0.0", "80" where idle_timeout' = None)
class val ServerConfig

Constructors

create

[Source]

Create server configuration.

host' and port' specify the listen address. Parser limits default to sensible values. idle_timeout' is an IdleTimeout (milliseconds) or None to disable idle timeout. Defaults to 60 seconds. Use lori.MakeIdleTimeout(ms) to create custom timeout values. max_pending_responses' limits the number of pipelined requests that can be outstanding before the connection closes — this prevents unbounded memory growth from actors that never respond.

new val create(
  host': String val,
  port': String val,
  max_request_line_size': USize val = 8192,
  max_header_size': USize val = 8192,
  max_chunk_header_size': USize val = 128,
  max_body_size': USize val = 1048576,
  max_pending_responses': USize val = 100,
  idle_timeout': (Constrained[U64 val, IdleTimeoutValidator val] val | None val) = call)
: ServerConfig val^

Parameters

Returns


Public fields

let host: String val

[Source]


let port: String val

[Source]


let max_request_line_size: USize val

[Source]


let max_header_size: USize val

[Source]


let max_chunk_header_size: USize val

[Source]


let max_body_size: USize val

[Source]


let max_pending_responses: USize val

[Source]


let idle_timeout: (Constrained[U64 val, IdleTimeoutValidator val] val | None val)

[Source]