-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sending Blob #2206
Comments
It is not for historic reasons, see nodejs/undici#1795 (comment). |
This is an important context, thanks for sharing! So, Blobs being written first is a Node.js thing? This is also interesting:
Especially given that the default |
Yes, because there is no official API to get an
I think it is affected by the issue I wrote in that comment. |
See also nodejs/undici#1795 (comment). |
Got it. Thanks for the great references! Do you consider this proposal to be out of scope? We should close it then. |
It is doable but in my opinion it is not worth it. Added complexity for little to no benefit. |
What about supporting this only on the surface level? Accepting the My main use case is showcasing |
It is not trivial because again, converting a It is a lot easier to convert the websocket.send(await blob.arrayBuffer()); |
I keep missing this bit. Got it.
|
Yes, |
I understand this. What I'm proposing is not a matter of convenience but expectations. As in, valid WebSocket usage as per spec should work. Sending a I also understand that |
Strictly following the WHATWG specification is a non-goal for |
That is correct for |
Thank you for your work on this! 💪 |
Is there an existing issue for this?
Description
Currently,
ws
doesn't acceptBlob
as an argument to the.send()
function: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 sendingBlob
from the server.Actual result
.send()
;TypeError
:Attachments
No response
The text was updated successfully, but these errors were encountered: