connect-bidi-web
    Preparing search index...

    Function websocketToDuplexMessageStream

    • Adapts a ws WebSocket connection to a DuplexMessageStream for handleMuxedBidiSocket. Message boundaries are preserved, as the muxed protocol requires: each binary message becomes exactly one readable chunk, and each written chunk is sent as one binary WebSocket message. Closing or erroring the socket in either direction propagates to both the readable and the writable side.

      Parameters

      • ws: WebSocket

      Returns DuplexMessageStream