Required Instance Propertyswift-nio 2.72.0NIOHTTP1
requiredUpgradeHeaders
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.
NIOHTTPClientUpgradeHandler.swift:70var requiredUpgradeHeaders: [String] { get }
Other requirements
Instance members
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 shouldAllowUpgrade(upgradeResponse: HTTPResponseHead
) -> Bool Gives the receiving upgrader the chance to deny the upgrade based on the upgrade HTTP response.
func upgrade(context: ChannelHandlerContext, upgradeResponse: HTTPResponseHead
) -> EventLoopFuture<Void> 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.