configureHTTP2Pipeline(mode:connectionConfiguration:streamConfiguration:streamDelegate:position:inboundStreamInitializer:)

Configures a ChannelPipeline to speak HTTP/2.

HTTP2PipelineHelpers.swift:239
func configureHTTP2Pipeline(mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, streamDelegate: NIOHTTP2StreamDelegate? = nil, position: ChannelPipeline.Position = .last, inboundStreamInitializer: @escaping NIOChannelInitializer) -> EventLoopFuture<NIOHTTP2Handler.StreamMultiplexer>

Parameters

mode

The mode this pipeline will operate in, server or client.

connectionConfiguration

The settings that will be used when establishing the connection. These will be sent to the peer as part of the handshake.

streamConfiguration

The settings that will be used when establishing new streams. These mainly pertain to flow control.

streamDelegate

The delegate to be notified in the event of stream creation and close.

position

The position in the pipeline into which to insert this handler.

inboundStreamInitializer

A closure that will be called whenever the remote peer initiates a new stream.

Returns

An EventLoopFuture containing the StreamMultiplexer inserted into this pipeline, which can be used to initiate new streams.

In general this is not entirely useful by itself, as HTTP/2 is a negotiated protocol. This helper does not handle negotiation. Instead, this simply adds the handler required to speak HTTP/2 after negotiation has completed, or when agreed by prior knowledge. Whenever possible use this function to setup a HTTP/2 server pipeline, as it allows that pipeline to evolve without breaking your code.