-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Is there an existing issue for this?
- I've searched for any related issues and avoided creating a duplicate issue.
Description
Currently, ws
doesn't accept Blob
as an argument to the .send()
function:
wss.on('connection', (ws) => ws.send(new Blob(['hello']))
I believe this is mainly for historic reasons because there used to be no Blob
in Node.js. There is now, and it would be great to align the sending (and receiving also) with the WHATWG WebSocket standard.
ws version
8.16.0
Node.js Version
v20.11.0
System
Irrelevant.
Expected result
ws
supports sending Blob
from the server.
Actual result
- Type error on the unknown input type to
.send()
; - A runtime
TypeError
:
TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Blob
Attachments
No response
Metadata
Metadata
Assignees
Labels
No labels