WebSocket has no auto-reconnect
Unlike EventSource, the native browser WebSocket does not reconnect when the connection drops. This is intentional: reconnection policy depends on your application — chat reconnects aggressively; a one-shot streaming export does not. The protocol stays out of your way.
Exponential backoff with jitter
The industry standard is exponential backoff with jitter. After each failure, wait min(base * 2^retry, cap) seconds; add a randomized jitter of ±25% so 10,000 clients reconnecting simultaneously do not pile onto the recovering server in lockstep ("thundering herd"). Reset the retry counter on the next successful open.
What to skip on close 1000
Do not reconnect on a clean close (code 1000) — the application asked for it. Do reconnect on 1001, 1006, 1011, and most 4xxx codes. For 4001 (auth expired), prompt for re-auth instead of blindly reconnecting.