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.