Vapor Documentation Beta

Structure HTTPServer.​Configuration

public struct Configuration

Engine server config struct.

let serverConfig = HTTPServerConfig.default(port: 8123)
services.register(serverConfig)

Member Of

HTTPServer

Nested Types

HTTPServer.Configuration.CompressionConfiguration

Supported HTTP compression options.

HTTPServer.Configuration.DecompressionConfiguration

Supported HTTP decompression options.

Initializers

init(hostname:​port:​backlog:​reuse​Address:​tcp​NoDelay:​response​Compression:​request​Decompression:​support​Pipelining:​support​Versions:​tls​Configuration:​server​Name:​logger:​)

public init(hostname: String = Self.defaultHostname, port: Int = Self.defaultPort, backlog: Int = 256, reuseAddress: Bool = true, tcpNoDelay: Bool = true, responseCompression: CompressionConfiguration = .disabled, requestDecompression: DecompressionConfiguration = .disabled, supportPipelining: Bool = false, supportVersions: Set<HTTPVersionMajor>? = nil, tlsConfiguration: TLSConfiguration? = nil, serverName: String? = nil, logger: Logger? = nil)

init(address:​backlog:​reuse​Address:​tcp​NoDelay:​response​Compression:​request​Decompression:​support​Pipelining:​support​Versions:​tls​Configuration:​server​Name:​logger:​)

public init(address: BindAddress, backlog: Int = 256, reuseAddress: Bool = true, tcpNoDelay: Bool = true, responseCompression: CompressionConfiguration = .disabled, requestDecompression: DecompressionConfiguration = .disabled, supportPipelining: Bool = false, supportVersions: Set<HTTPVersionMajor>? = nil, tlsConfiguration: TLSConfiguration? = nil, serverName: String? = nil, logger: Logger? = nil)

Properties

default​Hostname

let defaultHostname = "127.0.0.1"

default​Port

let defaultPort = 8080

address

var address: BindAddress

Address the server will bind to.

hostname

var hostname: String

Host name the server will bind to.

port

var port: Int

Port the server will bind to.

backlog

var backlog: Int

Listen backlog.

reuse​Address

var reuseAddress: Bool

When true, can prevent errors re-binding to a socket after successive server restarts.

tcp​NoDelay

var tcpNoDelay: Bool

When true, OS will attempt to minimize TCP packet delay.

response​Compression

var responseCompression: CompressionConfiguration

Response compression configuration.

request​Decompression

var requestDecompression: DecompressionConfiguration

Request decompression configuration.

support​Pipelining

var supportPipelining: Bool

When true, HTTP server will support pipelined requests.

support​Versions

var supportVersions: Set<HTTPVersionMajor>

tls​Configuration

var tlsConfiguration: TLSConfiguration?

server​Name

var serverName: String?

If set, this name will be serialized as the Server header in outgoing responses.

logger

var logger: Logger

Any uncaught server or responder errors will go here.