
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
socket.io-msgpack-parser
Advanced tools
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).
Please note that you MUST use the parser on both sides (server & client).
See also:
Compatibility table:
Parser version | Socket.IO server version |
---|---|
2.x | 1.x / 2.x |
3.x | 3.x / 4.x |
const io = require('socket.io');
const ioc = require('socket.io-client');
const customParser = require('socket.io-msgpack-parser');
const server = io(PORT, {
parser: customParser
});
const socket = ioc('ws://localhost:' + PORT, {
parser: customParser
});
socket.on('connect', () => {
socket.emit('hello');
});
socket.emit('hello', 'you')
will create the following packet:
{
"type": 2,
"nsp": "/",
"data": ["hello", "you"]
}
which will be encoded by the parser as:
<Buffer 83 a4 74 79 70 65 02 a3 6e 73 70 a1 2f a4 64 61 74 61 92 a5 68 65 6c 6c 6f a3 79 6f 75>
More information about the exchange protocol can be found here.
FAQs
socket.io parser based on msgpack
The npm package socket.io-msgpack-parser receives a total of 6,415 weekly downloads. As such, socket.io-msgpack-parser popularity was classified as popular.
We found that socket.io-msgpack-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.