diff --git a/src/transports/webSocket.ts b/src/transports/webSocket.ts index ceff822..96e0b3d 100644 --- a/src/transports/webSocket.ts +++ b/src/transports/webSocket.ts @@ -24,7 +24,13 @@ export class WebSocketPeer extends BasePeer implements Peer { this._socket.addEventListener( "message", async (event: MessageEvent) => { - await callback(event.data); + let data = event.data; + + if (data instanceof Blob) { + data = Buffer.from(await data.arrayBuffer()); + } + + await callback(data); }, );