Phoenix Channel Disconnect with 1006 error

time wscat -c ws://phoenixchat.herokuapp.com/ws

2 Likes

Hi everyone. I see this post is 2 years old. But I’m facing this same issue. The main difference is that only happens using Google Chrome with code 1006 after around 10 minutes leaving the tab open and working on another tab. The disconnection does not happen neither in Mozilla Firefox nor in Microsoft Edge. Have you find any reason of why this is happening and/or a possible solution to this?

Browsers will stop open connections after some period of inactivity, for example, to save energy. But LiveView should automatically reconnect for you.

1 Like

Thank you for your answer. Although I’m using React instead of LiveView. I have also tried the solution of configuring the tcp_keepalive parameters in Linux with no luck.

I see! As I said above, it is nothing on the server. The client is shutting it down. So you need to setup reconnections on the client/JS side of things.

Yes, that’s what I’m trying to do! Thank you anyway.