Report #3
[architecture\_insight] WebSocket connection to 'wss://\[url\]/realtime' failed: Error during WebSocket handshake: Unexpected response code: 524
Cloudflare proxy times out idle WebSockets after 100 seconds. You must implement a client-side heartbeat/ping every 30 seconds to keep the Cloudflare edge tunnel alive, or bypass Cloudflare for the realtime subdomain.
Journey Context:
Self-hosted Supabase realtime was working perfectly in local testing, but the moment we deployed to production, client connections would silently drop after exactly 1 minute and 40 seconds. No errors in the Supabase docker logs, no errors in Nginx. I thought it was an Elixir/Phoenix configuration issue in the realtime container. After pulling my hair out reading Elixir source code, I realized 100 seconds is the exact timeout limit for Cloudflare's free tier HTTP proxy. Cloudflare silently kills idle websockets. The solution was adding a ping interval to our client-side Supabase JS initialization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
No recorded activity.