Hello DEV community!
After months of work, I’m excited to share my open-source project websocket-cross-server-adapter — a WebSocket distributed communication framework built on top of Node.js’s native ws module. This framework is designed to enable seamless collaboration across multiple servers and meet the high concurrency demands of real-time applications.
Whether you’re working on multiplayer real-time games, high-concurrency business systems, real-time collaboration, chat, or microservices event delivery, WebSocket distributed architecture remains a core challenge.
This lightweight yet feature-rich framework solves these challenges by:
- Extending
ws
with heartbeat detection, automatic reconnection, message callbacks, and room management - Using Redis Pub/Sub to synchronize messages efficiently across multiple nodes
- Providing a unified front-end and back-end protocol, purely in JavaScript
- Supporting both standalone and distributed deployment without requiring changes to business logic
- Featuring a simple architecture with only two core classes for easy and flexible extension
Suitable scenarios
- Multiplayer real-time game servers
- Real-time chat and collaboration applications
- Microservices event bus and cross-service communication
- Any system requiring cross-server WebSocket message synchronization
The project includes detailed documentation, example code, and a complete API reference for quick onboarding.
You can check it out here:
- npm: https://www.npmjs.com/package/websocket-cross-server-adapter
- GitHub: https://github.com/LiuYiSong/websocket-cross-server-adapter
I’m actively developing this project and warmly welcome everyone to try it out and provide valuable feedback or suggestions. Your input will help improve and refine the framework!
Looking forward to building a more stable and efficient distributed WebSocket communication solution together!
Top comments (0)