Socket is an open-source, developer-friendly reconnecting WebSocket library for JavaScript, designed to enhance your development experience (DX).
- Authentication and Dynamic URL support
- Built-in APIs for Connection Status and Lost Connection handling
- Easy configuration for Heartbeats (PING/PONG)
- Listens to Network and Focus events (configurable)
- Flexible Stop Retry options for managing reconnections
- Customizable Reconnection Delays
- Buffering support during offline periods
You can find the documentation for Socket here.
Hi, I’m Ace, currently working on a next-gen multiplayer framework for real-time and collaborative apps. My mission is to greatly improve the developer experience (DevEx) for creating multiplayer and real-time applications, and this is my first release!
Reconnecting WebSockets are challenging—getting them right is even harder. Adding features like heartbeats and other complexities makes it even more error-prone. Throughout my career, I've seen countless reconnecting WebSocket implementations that work, but often have edge case bugs and race conditions. Even the best ones aren't immune (like the Liveblocks WebSocket bug I discovered and helped fix: issue & PR).
With this project, I aim to provide the community with a DevEx-focused reconnecting WebSocket library that simplifies everything. And if bugs or edge cases are found, they’ll be fixed—for everyone.
If you’re interested in trying out a new framework, join our Discord for early access. I’m also looking for early adopters. To set expectations, it’ll likely be open-source but behind a paid license for commercial usage (maybe ^^).
If you find Socket useful, please consider starring this repository on GitHub! Your support helps others discover the project.
You can also follow me on Twitter @_shibru_ for updates and feel free to share this project with your network. Let’s make real-time web development smoother together!
This project takes inspiration from some of my past works reconnecting websocket (counter machine pattern) & partyworks's implementation. and the APIs are also hugely inspired by liveblocks (it's a team whose work I respect and admire alot). also thankx to @threepointone for sponsoring this in the past.
Resocket ~ Ace