Instance Methodswift-nio 2.81.0NIOWebSocket
addCustom(upgradeRequestHeaders:)
NIOWebSocketClientUpgrader.swift:114- iOS
- 16+
- macOS
- 13+
- tvOS
- 16+
- watchOS
- 9+
func addCustom(upgradeRequestHeaders: inout NIOHTTP1.HTTPHeaders)
func addCustom(upgradeRequestHeaders: inout NIOHTTP1.HTTPHeaders)
s12NIOWebSocket011NIOTypedWebB14ClientUpgraderC9addCustom21upgradeRequestHeadersy8NIOHTTP111HTTPHeadersVz_tF
What are these?5HB0Q
import NIOWebSocket
final class NIOTypedWebSocketClientUpgrader<UpgradeResult> where UpgradeResult : Sendable
A NIOTypedHTTPClientProtocolUpgrader
that knows how to do the WebSocket upgrade dance.
struct HTTPHeaders
A representation of a block of HTTP header fields.
init(requestKey: String = NIOWebSocketClientUpgrader.randomRequestKey(), maxFrameSize: Int = 1 << 14, enableAutomaticErrorHandling: Bool = true, upgradePipelineHandler: @escaping (Channel, HTTPResponseHead) -> EventLoopFuture<UpgradeResult>)
let requiredUpgradeHeaders: [String]
None of the websocket headers are actually defined as ‘required’.
let supportedProtocol: String
RFC 6455 specs this as the required entry in the Upgrade header.
func shouldAllowUpgrade(upgradeResponse: HTTPResponseHead) -> Bool
func upgrade(channel: Channel, upgradeResponse: HTTPResponseHead) -> EventLoopFuture<UpgradeResult>