We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Blob
1 parent 395e066 commit 86b7959Copy full SHA for 86b7959
src/lib/connect/ws.ts
@@ -256,9 +256,11 @@ const browserStreamBuilder: StreamBuilder = (client, opts) => {
256
/**
257
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event
258
*/
259
- function onMessage(event: MessageEvent) {
+ async function onMessage(event: MessageEvent) {
260
let { data } = event
261
if (data instanceof ArrayBuffer) data = Buffer.from(data)
262
+ else if (data instanceof Blob)
263
+ data = Buffer.from(await new Response(data).arrayBuffer())
264
else data = Buffer.from(data as string, 'utf8')
265
if (proxy && !proxy.destroyed) {
266
proxy.push(data)
0 commit comments