init(upgraders:httpHandlers:upgradeCompletionHandler:)
Create a HTTPClientUpgradeHandler.
convenience init(upgraders: [any NIOHTTPClientProtocolUpgrader], httpHandlers: [any RemovableChannelHandler], upgradeCompletionHandler: @escaping (ChannelHandlerContext) -> Void) Parameters
- upgraders
All
HTTPClientProtocolUpgraderobjects that will add their upgrade request headers and handle the upgrade if there is a response for their protocol. They should be placed in order of the preference for the upgrade.- httpHandlers
All
RemovableChannelHandlerobjects which will be removed from the pipeline once the upgrade response is sent. This is used to ensure that the pipeline will be in a clean state after the upgrade. It should include any handlers that are directly related to handling HTTP. At the very least this should include theHTTPEncoderandHTTPDecoder, but should also include any other handler that cannot tolerate receiving non-HTTP data.- upgradeCompletionHandler
A closure that will be fired when HTTP upgrade is complete.