NIOTypedHTTPServerUpgradeHandler

    A server-side channel handler that receives HTTP requests and optionally performs an HTTP-upgrade.

    NIOTypedHTTPServerUpgradeHandler.swift:78
    iOS
    16+
    macOS
    13+
    tvOS
    16+
    watchOS
    9+
    final class NIOTypedHTTPServerUpgradeHandler<UpgradeResult> where UpgradeResult : Sendable

    Removes itself from the channel pipeline after the first inbound request on the connection, regardless of whether the upgrade succeeded or not.

    This handler behaves a bit differently from its Netty counterpart because it does not allow upgrade on any request but the first on a connection. This is primarily to handle clients that pipeline: it’s sufficiently difficult to ensure that the upgrade happens at a safe time while dealing with pipelined requests that we choose to punt on it entirely and not allow it. As it happens this is mostly fine: the odds of someone needing to upgrade midway through the lifetime of a connection are very low.

    Citizens in NIOHTTP1

    Conformances

    • protocol ChannelHandler

      Base protocol for handlers that handle I/O events or intercept an I/O operation.

    • protocol ChannelInboundHandler

      ChannelHandler which handles inbound I/O events for a Channel.

    • protocol RemovableChannelHandler

      A RemovableChannelHandler is a ChannelHandler that can be dynamically removed from a ChannelPipeline whilst the Channel is operating normally. A RemovableChannelHandler is required to remove itself from the ChannelPipeline (using ChannelHandlerContext.leavePipeline) as soon as possible.

    Show implementation details (2)

    Hide implementation details

    Typealiases

    Type members

    Instance members

    Instance features