Adapts a BidiWebSocketLike (an accepted Workers WebSocket, or a mock
of one in tests) into the DuplexMessageStream that
@sudorandom/connect-bidi-core's handleMuxedBidiSocket bridges to
Connect UniversalHandlers. Message boundaries are preserved, as the
muxed protocol requires: each message becomes exactly one readable
chunk, and each written chunk is sent as one WebSocket message.
Message frames are converted to Uint8Array regardless of whether they
arrive as text or binary, matching @sudorandom/connect-bidi-web's
browser transports, which always send binary frames but whose peer could
in principle be any WebSocket client.
Adapts a
BidiWebSocketLike(an accepted WorkersWebSocket, or a mock of one in tests) into theDuplexMessageStreamthat@sudorandom/connect-bidi-core'shandleMuxedBidiSocketbridges to ConnectUniversalHandlers. Message boundaries are preserved, as the muxed protocol requires: each message becomes exactly one readable chunk, and each written chunk is sent as one WebSocket message.Message frames are converted to
Uint8Arrayregardless of whether they arrive as text or binary, matching@sudorandom/connect-bidi-web's browser transports, which always send binary frames but whose peer could in principle be any WebSocket client.