ReconnectingWebSocket is a small JavaScript library that wraps the standard WebSocket API with automatic reconnection behavior. It is designed as a drop-in replacement, so developers can switch from WebSocket to ReconnectingWebSocket with minimal code changes. When a connection closes, the library automatically attempts to reconnect instead of leaving the socket dead. It keeps trying until the connection succeeds or until a configured attempt limit is reached. The library includes options for debug logging, automatic opening, reconnect intervals, maximum reconnect delay, reconnect decay, timeouts, and maximum attempts. Overall, it is useful for real-time web apps that need more resilient WebSocket connections.
Features
- Drop-in wrapper for the JavaScript WebSocket API
- Automatic reconnection after connection loss
- Repeated reconnect attempts until success or limit
- Configurable reconnect interval and maximum delay
- Connection timeout and reconnect decay options
- Debug logging and manual open or close controls
Categories
DesignLicense
MIT LicenseFollow ReconnectingWebSocket
Other Useful Business Software
$300 Free Credits to Build on Google Cloud
Start your next project with $300 in free Google Cloud credit. Spin up VMs, run containers, query petabytes in BigQuery, or build agents with Gemini Enterprise Agent Platform. Once your credits are used, keep building with 20+ always-free tier products including Compute Engine, Cloud Storage, GKE, and Cloud Run functions. No commitment required—just sign up and start building.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of ReconnectingWebSocket!