Node.js websocket connections closing after 5 minutes

Hello everyone,

I had deployed a basic websocket server using Node.js and ws library. The problem I’m currently facing is that the websocket connections close after 5 minutes. I tried logging any error codes to see if I could solve the problem myself and here’s what I received:

1006 Abnormal Closure: No close frame was received.

I tried connecting to the server using Chrome as well as Postman and I’m getting the same result. The server works fine locally though.

I thought maybe it was due to inactivity but then I sent and received messages from the server and the connection still closed after 5 minutes of connecting to the server.

I would really appreciate it if someone could help me solve this problem.

Hi Debabrata,

This may be due to some of the limitations of our Free Plan, namely that the services are spun down due to inactivity and can be restarted at any time https://render.com/docs/free#other-limitations which would cause web socket connections to close as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.