maxsocket

JSON →
library 1.0.2 ·javascript
verified Jun 7, 2026

maxsocket is a lightweight (~0.9 kB min+gzip) WebSocket client library offering built-in auto-reconnect, offline message queuing, JSON handling, and event routing. Current stable version is 1.0.2. It provides a functional API with explicit lifecycle handlers (onConnect, onMessage, onClose) instead of generic event listeners, and includes an event routing system for structured server messages. Unlike alternatives like reconnecting-websocket (2.6 kB) and simple-websocket (13.8 kB), maxsocket focuses on small bundle size, simplicity for modern frontends (React, Vue, Svelte, vanilla JS), and built-in features that reduce boilerplate. It is ESM-only and uses the native browser WebSocket API.