Resilient WebSocket client with automatic reconnection, exponential backoff, and heartbeat management.