em-rtc-parser
This parser mainly concists of a fork of socket.io-parser with some added logic for chunking binary data. This may or may not be appropriate to merge back but in the meantime it lives here for inclusion in socket.io-p2p.
A socket.io encoder and decoder written in JavaScript complying with version 3
of socket.io-protocol.
Used by socket.io and
socket.io-client.
Parser API
socket.io-parser is the reference implementation of socket.io-protocol. Read the full API here: socket.io-protocol.
Example Usage
Encoding and decoding a packet
var parser = ;var encoder = ;var packet = type: parserEVENT data: 'test-packet' id: 13;encoder;
Encoding and decoding a packet with binary data
var parser = ;var encoder = ;var packet = type: parserBINARY_EVENT data: i: 1234 j: 2 id: 15;encoder;
See the test suite for more examples of how socket.io-parser is used.
License
MIT