@unibtc/socket.io-msgpack-parser
v2.3.2
Published
socket.io parser based on msgpack
Downloads
4
Readme
socket.io-msgpack-parser
An alternative to the default socket.io-parser, encoding and decoding packets with @msgpack/msgpack.
With that parser, the browser build will be a bit heavier (an additional 7.5 KB minified, 3.0 KB gzipped), but each message will be smaller (sent as binary).
Recommended
- NodeJs v12
Required
- NodeJs v10
Usage
const io = require('socket.io');
const ioc = require('socket.io-client');
const customParser = require('socket.io-msgpack-parser');
let server = io(PORT, {
parser: customParser
});
let client = ioc('ws://localhost:' + PORT, {
parser: customParser
});
client.on('connect', () => {
client.emit('hello');
});