As far as i know websockets support binary data transfer. Binary support bug is fixed.
So, are there any websocket servers which support binary data transfer? Socket.io seems to miss this opportunity. Maybe there are some others?
API Gateway WebSocket APIs don't currently support binary frames in incoming message payloads. If a client app sends a binary frame, API Gateway rejects it and disconnects the client with code 1003.
WebSocket enables bidirectional, message-oriented streaming of text and binary data between client and server. It is the closest API to a raw network socket in the browser.
In the browser, we directly work only with text or binary frames. WebSocket . send() method can send either text or binary data.
You might be using WebSockets incorrectly if: The connection is used only for a very small number of events, or a very small amount of time, and the client does not need to quickly react to the events. Your feature requires multiple WebSockets to be open to the same service at once.
Supporting binary data in WebSocket servers is pretty trivial (less work that UTF-8 actually). The real problem is supporting binary data types in the browser. It is being worked on, but as of yet there are no browser releases that can support sending and receiving binary types (typed arrays, blobs).
If you need to send binary data now before browsers add support, you can try my websockify python server and Javascript client library. It uses base64 encoding to transfer binary data over the wire. Instead of typed arrays/blobs, it uses arrays of numbers (0-255) to represent binary data on the Javascript side.
Some links:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With