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
Ship Agents Faster
Gemini Enterprise Agent Platform lets you rapidly build, scale, govern and optimize production-ready agents grounded in your organization's data. The platform enables developers to build custom or pre-built agents for virtually any use case. New customers get $300 in free credits.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of ReconnectingWebSocket!