WebSocket and Socket.IO Mocking Library

JSON →
library 9.3.1 ·javascript
verified May 27, 2026

mock-socket is a JavaScript library designed for mocking WebSocket and Socket.IO connections, facilitating isolated testing of client-side code that interacts with these protocols. The current stable version is 9.3.1. Releases appear to be driven by feature additions, bug fixes, and dependency updates, with major versions typically indicating breaking API changes or significant environment requirements (like Node.js version bumps). Key differentiators include its ability to intercept and control WebSocket and Socket.IO traffic, allowing developers to simulate server responses, connection states, and various network conditions without needing a real backend. It also offers the flexibility to globally stub the `WebSocket` object or manually inject its mocks, and ships with comprehensive TypeScript definitions for improved developer experience. While it supports Socket.IO, this support is explicitly noted as limited.

total hits 14
actors 7 distinct systems
last hit 5d ago MetaBot
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇳🇴 Norway · 🇩🇪 Germany · 🇫🇷 France