JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11505
  • Score
    100M100P100Q138942F
  • License MIT

socket.io parser based on msgpack

Package Exports

  • socket.io-msgpack-parser

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (socket.io-msgpack-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

socket.io-msgpack-parser

An alternative to the default socket.io-parser, encoding and decoding packets with 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).

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');
});