configureHTTP2Pipeline(mode:initialLocalSettings:position:targetWindowSize:inboundStreamStateInitializer:)

Configures a ChannelPipeline to speak HTTP/2.

HTTP2PipelineHelpers.swift:152

This declaration has been renamed to Channel.configureHTTP2Pipeline(mode:initialLocalSettings:position:targetWindowSize:inboundStreamInitializer:).

This declaration is deprecated.

func configureHTTP2Pipeline(mode: NIOHTTP2Handler.ParserMode, initialLocalSettings: [HTTP2Setting] = nioDefaultSettings, position: ChannelPipeline.Position = .last, targetWindowSize: Int, inboundStreamStateInitializer: NIOChannelInitializerWithStreamID? = nil) -> EventLoopFuture<HTTP2StreamMultiplexer>

Parameters

mode

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

initialLocalSettings

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

position

The position in the pipeline into which to insert these handlers.

targetWindowSize

The target size of the HTTP/2 flow control window.

inboundStreamStateInitializer

A closure that will be called whenever the remote peer initiates a new stream. This should almost always be provided, especially on servers.

Returns

An EventLoopFuture containing the HTTP2StreamMultiplexer 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 handlers 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.