Setu-TS
    Preparing search index...

    Class NodeUpgradeCoordinator

    Owns the ws server for one Node HTTP adapter and performs the handshake.

    Split out of the adapter so the adapter keeps its single responsibility (mapping HTTP) and so the handshake's branches are measurable in isolation. The ws server is created on the first accepted upgrade — a plain HTTP application therefore never loads the optional dependency at all.

    0.2.0

    Index
    • Completes the RFC 6455 handshake over an already-accepted TCP connection and binds the resulting socket to the decision's sink.

      Parameters

      • incoming: NodeIncomingMessage

        The Node request from the upgrade event

      • socket: unknown

        The raw duplex socket

      • head: unknown

        The bytes the HTTP parser already buffered

      • sink: WebSocketEventSink

        The sink to bind the completed socket into

      • Optionalprotocol: string

        The negotiated subprotocol to echo, when one was selected

      Returns Promise<void>

      If ws is not installed