Skip to content

Add/binary support#622

Merged
rauchg merged 6 commits intosocketio:masterfrom
kevin-roark:add/binary-support
Feb 21, 2014
Merged

Add/binary support#622
rauchg merged 6 commits intosocketio:masterfrom
kevin-roark:add/binary-support

Conversation

@kevin-roark
Copy link

Building on engine.io's new binary support, added cross-browser support of sending and receiving events with binary data to socket.io client. Supports sending of Buffers, ArrayBuffers, Blobs, and Files. In the process, rewrote the interface with socket.io-parser to deal with the new asynchronous encoding.

See https://github.com/kevin-roark/socketio-binaryexample for an example of how it works.

Added changes to reflect socket.io-parser's async encoding, and use
of has-binarydata to check the event type of an event.

Next added browser tests for sending and receiving of binary data via
arraybuffers.

Then added blob tests and blob recognition.

To make blobs fully work (and Files as well), had to add packet buffering
to client so that slow-encoding blobs are still sent before other events.

I fixed a stupid bug I had added where I used the indexof module (for old
browsers) on a string somewhere instead of an array). This was causing
old IE to receive all events twice.

Old iphone tests were still failing so I updated tests to reflect that
some browsers can receive a blob but not construct them.

Finally, reduced build size by adding the "browser" field to package.json
and making browserify less confused.
@rase-
Copy link
Contributor

rase- commented Feb 19, 2014

👍

@kevin-roark
Copy link
Author

Hey y'all -- just updated the tests to not pollute the window and abstracted text-blob-builder into a separate module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants