# pocket.io **Repository Path**: mirrors_WebReflection/pocket.io ## Basic Information - **Project Name**: pocket.io - **Description**: A minimalistic version of socket.io that weights about 1K instead of 60K. - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README pocket.io ========= A minimalistic version of [socket.io](https://socket.io) that weights about 1K instead of 60K. ```html ``` On the Node.js side, you do the same you are doing now. Try `node test/chat-express.js` and visit `localhost:3000` to see the classic chat demo working. ```js var app = require('express')(); var http = require('http').Server(app); var io = require('pocket.io')(http); app.get('/', function(req, res){ res.sendFile(__dirname + '/chat.html'); }); io.on('connection', function(socket){ console.log('a user connected'); socket.on('chat message', function (msg) { io.emit('chat message', msg); }); socket.on('disconnect', function () { console.log('disconnected'); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); }); ``` ### API differences You can specify a JSON like parser through the option. As example, this is how you'd use recursion compatible serialization via the [flatted](https://github.com/WebReflection/flatted#flatted) module. ```js // Node.js io(server, {JSON: require('flatted/cjs')}); // client, after having Flatted exposed somehow, i.e. // io({JSON: Flatted}); ```