crimsonsky2005
crimsonsky2005

Reputation: 2963

socket.io binary support documentation

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

Answers (4)

David Castillo
David Castillo

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

eudaimos
eudaimos

Reputation: 675

Updating for people who get here, take a look at socket.io-stream

Upvotes: 1

Nachiketha
Nachiketha

Reputation: 23535

There's one more module which helps greatly for sending binary dta with socket.io

Try deliveryjs

https://github.com/liamks/Delivery.js

which provides the means of binary data communication between clients and server via socket.io. (but uses base64 conversion method)

Upvotes: 1

3rdEden
3rdEden

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

Related Questions