Phoenix LiveView issue in production: "Proxy connection could not be established, unexpected response code"

Hi,

i have a LiveView-based dashboard on my page which handles the current user location via socket assigns. Yes, I know that Live Routes are the sanctioned approach for my use case. This is an issue I’d still like to understand, though.

Occasionally, without any action on my part, the LiveView will reset to the initial state (i.e. the dashboard landing page), and I’ll get a console error that looks like:

WebSocket network error: Proxy connection could not be established, unexpected response code

(From Safari, since Firefox just clears the console without me being able to see what’s going on. It doesn’t show the response code.)

This happens after a random amount of time. It only happens in production, so I can’t reproduce this in my development environment and get a more accurate reading of what’s going on. I’m using a Render web service.

Has anyone else encountered a similar issue? Does it have to do with my app’s production configuration, or maybe the Render service itself?

Thanks!