Instance Methodswift-nio 2.72.0NIOWebSocket
buildUpgradeResponse(channel:upgradeRequest:initialResponseHeaders:)
NIOWebSocketServerUpgrader.swift:162func buildUpgradeResponse(channel: Channel, upgradeRequest: HTTPRequestHead, initialResponseHeaders: HTTPHeaders) -> EventLoopFuture<HTTPHeaders>
Other members in extension
Type members
init(automaticErrorHandling: Bool, shouldUpgrade: @escaping (Channel, HTTPRequestHead) -> EventLoopFuture<HTTPHeaders?>, upgradePipelineHandler: @escaping (Channel, HTTPRequestHead) -> EventLoopFuture<Void>
) Create a new
NIOWebSocketServerUpgrader
.init(maxFrameSize: Int, automaticErrorHandling: Bool, shouldUpgrade: @escaping (Channel, HTTPRequestHead) -> EventLoopFuture<HTTPHeaders?>, upgradePipelineHandler: @escaping (Channel, HTTPRequestHead) -> EventLoopFuture<Void>
) Create a new
NIOWebSocketServerUpgrader
.
Instance members
let requiredUpgradeHeaders: [String]
We deliberately do not actually set any required headers here, because the websocket spec annoyingly does not actually force the client to send these in the Upgrade header, which NIO requires. We check for these manually.
let supportedProtocol: String
RFC 6455 specs this as the required entry in the Upgrade header.
func upgrade(context: ChannelHandlerContext, upgradeRequest: HTTPRequestHead
) -> EventLoopFuture<Void>