Setu-TS
    Preparing search index...

    Type Alias WebSocketUpgradeDecision

    WebSocketUpgradeDecision:
        | { accept: true; protocol?: string; sink: WebSocketEventSink }
        | { accept: false; status: number }

    What an HTTP adapter should do with an inbound upgrade request, as decided by the WebSocketUpgradeRouter.

    Discriminated on accept, so an adapter narrows with a single check.

    Type Declaration

    • { accept: true; protocol?: string; sink: WebSocketEventSink }
      • Readonlyaccept: true

        Complete the handshake.

      • Optional Readonlyprotocol?: string

        The negotiated subprotocol to echo back, when one was selected. Omit to echo none — never echo a protocol the client did not request.

      • Readonlysink: WebSocketEventSink

        The sink the adapter binds its native socket events into.

    • { accept: false; status: number }
      • Readonlyaccept: false

        Refuse the handshake.

      • Readonlystatus: number

        The HTTP status to answer with (e.g. 503 at capacity, 400 on a bad subprotocol).

    0.2.0