Reputation: 2963
Can anyone point me to any sort of documentation for how to implement binary on socket.io? Its listed that they have added the support a few months ago, but i cant find any documentation for it.
Upvotes: 3
Views: 3401
Reputation: 4455
As of now, since 2014 (v1.0) Socket.IO supports binary files. I also wrote a blog post about how to use it (since I found the docs to be somewhat lacking)
Upvotes: 2
Reputation: 23535
There's one more module which helps greatly for sending binary dta with socket.io
Try deliveryjs
which provides the means of binary data communication between clients and server via socket.io. (but uses base64 conversion method)
Upvotes: 1
Reputation: 4416
Socket.IO doesn't support binary data as not all transports support this. What you should do instead is taking a look at http://binaryjs.com/
If you do not want to such a solution you will have to pack all your binary data in to a string and decode it again on the client side.. But this is basically the same that binaryjs is also doing. It using a customized messagepack (encoder) to send the data see https://github.com/binaryjs/js-binarypack
Upvotes: 2