websockets / ws

Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
MIT License
21.34k stars 2.3k forks source link

Add support for `Blob` #2229

Closed lpinca closed 6 days ago

lpinca commented 3 weeks ago

Closes #2206

lpinca commented 3 weeks ago

@kettanaito I'm still not very happy with this because, other than compatibility with the WHAWG spec, it is pretty much useless. Anyway, here it is. I also didn't run any benchmarks to see the impact on performance.

titanism commented 5 days ago

Hi there @lpinca, I can't confirm exactly what's wrong here, but I did a minor version bump and this entirely broke our implementation of ws. It's sending everything over the wire as a BLOB now instead of as a Buffer it seems. Seems to be a major breaking change (e.g. we are using msgpackr under the hood to pack/unpack messages sent via websockets, and now they are throwing an error Source must be a Uint8Array or Buffer but was a Blob).

lpinca commented 5 days ago

@titanism are you are setting websocket.binaryType to 'blob'? Let's continue the discussion in https://github.com/websockets/ws/issues/2239.