Required Instance Methodswift-nio 2.72.0NIOHTTP1
shouldAllowUpgrade(upgradeResponse:)
Gives the receiving upgrader the chance to deny the upgrade based on the upgrade HTTP response.
NIOTypedHTTPClientUpgradeHandler.swift:35func shouldAllowUpgrade(upgradeResponse: HTTPResponseHead) -> Bool
Other requirements
Type members
Instance members
var requiredUpgradeHeaders: [String]
All the header fields the protocol requires in the request to successfully upgrade. These header fields will be added to the outbound request’s “Connection” header field. It is the responsibility of the custom headers call to actually add these required headers.
var supportedProtocol: String
The protocol this upgrader knows how to support.
func addCustom(upgradeRequestHeaders: inout HTTPHeaders
) Additional headers to be added to the request, beyond the “Upgrade” and “Connection” headers.
func upgrade(channel: Channel, upgradeResponse: HTTPResponseHead
) -> EventLoopFuture<UpgradeResult> Called when the upgrade response has been flushed. At this time it is safe to mutate the channel pipeline to add whatever channel handlers are required. Until the returned
EventLoopFuture
succeeds, all received data will be buffered.