Structure
HTTPServer.Configuration
Engine server config struct.
struct Configuration
Overview
let serverConfig = HTTPServerConfig.default(port: 8123)
services.register(serverConfig)
Topics
Structures
struct RequestDecompressionConfigurationSupported HTTP decompression options.struct ResponseCompressionConfigurationSupported HTTP response compression options.
Initializers
init(address: BindAddress, backlog: Int, reuseAddress: Bool, tcpNoDelay: Bool, responseCompression: HTTPServer.Configuration.ResponseCompressionConfiguration, requestDecompression: HTTPServer.Configuration.RequestDecompressionConfiguration, supportPipelining: Bool, supportVersions: Set<HTTPVersionMajor>?, tlsConfiguration: TLSConfiguration?, serverName: String?, reportMetrics: Bool, logger: Logger?, shutdownTimeout: TimeAmount, customCertificateVerifyCallback: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResult>) -> Void)?, connectionsPerServerTick: UInt, idleTimeout: TimeAmount?)init(address: BindAddress, backlog: Int, reuseAddress: Bool, tcpNoDelay: Bool, responseCompression: HTTPServer.Configuration.ResponseCompressionConfiguration, requestDecompression: HTTPServer.Configuration.RequestDecompressionConfiguration, supportPipelining: Bool, supportVersions: Set<HTTPVersionMajor>?, tlsConfiguration: TLSConfiguration?, serverName: String?, reportMetrics: Bool, logger: Logger?, shutdownTimeout: TimeAmount, customCertificateVerifyCallbackWithMetadata: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResultWithMetadata>) -> Void)?, connectionsPerServerTick: UInt, idleTimeout: TimeAmount?)init(hostname: String, port: Int, backlog: Int, reuseAddress: Bool, tcpNoDelay: Bool, responseCompression: HTTPServer.Configuration.ResponseCompressionConfiguration, requestDecompression: HTTPServer.Configuration.RequestDecompressionConfiguration, supportPipelining: Bool, supportVersions: Set<HTTPVersionMajor>?, tlsConfiguration: TLSConfiguration?, serverName: String?, reportMetrics: Bool, logger: Logger?, shutdownTimeout: TimeAmount, customCertificateVerifyCallback: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResult>) -> Void)?, connectionsPerServerTick: UInt, idleTimeout: TimeAmount?)init(hostname: String, port: Int, backlog: Int, reuseAddress: Bool, tcpNoDelay: Bool, responseCompression: HTTPServer.Configuration.ResponseCompressionConfiguration, requestDecompression: HTTPServer.Configuration.RequestDecompressionConfiguration, supportPipelining: Bool, supportVersions: Set<HTTPVersionMajor>?, tlsConfiguration: TLSConfiguration?, serverName: String?, reportMetrics: Bool, logger: Logger?, shutdownTimeout: TimeAmount, customCertificateVerifyCallbackWithMetadata: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResultWithMetadata>) -> Void)?, connectionsPerServerTick: UInt, idleTimeout: TimeAmount?)
Instance Properties
var address: BindAddressAddress the server will bind to. Configuring an address using a hostname with a nil host or port will use the default hostname or port respectively.var backlog: IntListen backlog.var connectionsPerServerTick: UIntThe number of incoming TCP connections to accept per “tick” (i.e. each time through the server’s event loop).var customCertificateVerifyCallback: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResult>) -> Void)?An optional callback that will be called instead of using swift-nio-ssl’s regular certificate verification logic. This is the same asNIOSSLCustomVerificationCallbackbut just marked asSendablevar customCertificateVerifyCallbackWithMetadata: (([NIOSSLCertificate], EventLoopPromise<NIOSSLVerificationResultWithMetadata>) -> Void)?An optional callback that will be called instead of using swift-nio-ssl’s regular certificate verification logic. This is the same asNIOSSLCustomVerificationCallbackWithMetadatabut just marked asSendable.var hostname: StringHost name the server will bind to.var idleTimeout: TimeAmount?When set, inbound connections that have been idle for this duration will be closed. Default:nil(disabled).var logger: LoggerAny uncaught server or responder errors will go here.var port: IntPort the server will bind to.var reportMetrics: BoolWhentrue, report http metrics throughswift-metricsvar requestDecompression: HTTPServer.Configuration.RequestDecompressionConfigurationRequest decompression configuration.var responseCompression: HTTPServer.Configuration.ResponseCompressionConfigurationResponse compression configuration.var reuseAddress: BoolWhentrue, can prevent errors re-binding to a socket after successive server restarts.var serverName: String?If set, this name will be serialized as theServerheader in outgoing responses.var shutdownTimeout: TimeAmountA time limit to complete a graceful shutdownvar supportPipelining: BoolWhentrue, HTTP server will support pipelined requests.var supportVersions: Set<HTTPVersionMajor>var tcpNoDelay: BoolWhentrue, OS will attempt to minimize TCP packet delay.var tlsConfiguration: TLSConfiguration?
Type Aliases
Type Properties
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype