Configuration

public struct Configuration

HTTP server configuration

  • Bind address for server

    Declaration

    Swift

    public let address: HBBindAddress
  • Server name to return in “server” header

    Declaration

    Swift

    public let serverName: String?
  • Maximum upload size allowed

    Declaration

    Swift

    public let maxUploadSize: Int
  • Maximum size of buffer for streaming request payloads

    Declaration

    Swift

    public let maxStreamingBufferSize: Int
  • Defines the maximum length for the queue of pending connections

    Declaration

    Swift

    public let backlog: Int
  • Allows socket to be bound to an address that is already in use.

    Declaration

    Swift

    public let reuseAddress: Bool
  • Disables the Nagle algorithm for send coalescing.

    Declaration

    Swift

    public let tcpNoDelay: Bool
  • Pipelining ensures that only one http request is processed at one time

    Declaration

    Swift

    public let withPipeliningAssistance: Bool
  • TLS options for NIO Transport services

    Declaration

    Swift

    public let tlsOptions: TSTLSOptions
  • Initialize HTTP server configuration

    Declaration

    Swift

    public init(
        address: HBBindAddress = .hostname(),
        serverName: String? = nil,
        maxUploadSize: Int = 2 * 1024 * 1024,
        maxStreamingBufferSize: Int = 1 * 1024 * 1024,
        backlog: Int = 256,
        reuseAddress: Bool = true,
        tcpNoDelay: Bool = true,
        withPipeliningAssistance: Bool = true
    )

    Parameters

    address

    Bind address for server

    serverName

    Server name to return in “server” header

    maxUploadSize

    Maximum upload size allowed

    maxStreamingBufferSize

    Maximum size of buffer for streaming request payloads

    reuseAddress

    Allows socket to be bound to an address that is already in use.

    tcpNoDelay

    Disables the Nagle algorithm for send coalescing.

    withPipeliningAssistance

    Pipelining ensures that only one http request is processed at one time

  • Undocumented

    Declaration

    Swift

    public init(
        address: HBBindAddress = .hostname(),
        serverName: String? = nil,
        maxUploadSize: Int = 2 * 1024 * 1024,
        maxStreamingBufferSize: Int = 1 * 1024 * 1024,
        reuseAddress: Bool = true,
        withPipeliningAssistance: Bool = true,
        tlsOptions: TSTLSOptions
    )