Websocket deconnexion problem


I am encountering an issue with my Node.js web server, which is hosted behind Cloudflare. Recently, I implemented a WebSocket server using Express-WS. While everything works fine locally, I am experiencing random disconnections between 1 and 2 minutes after establishing a WebSocket connection with my client when the web server is behind Cloudflare.

I came across an old forum thread from 2017 that mentioned a timeout of 100 seconds for WebSocket connections, but I’m not sure if this is still relevant because the Cloudflare FAQ on WebSockets does not mention it.

Could someone confirm if there is still a WebSocket inactivity timeout enforced by Cloudflare and if it can be adjusted or disabled? I would appreciate any information or insights on this matter.

Thank you for your assistance.


I’m taking the liberty of up this ticket because I’ve noticed that sending one request per minute only maintains the connection for a couple of hours, to eventually also disconnect with the reason 1006 abnormal closure.

I still don’t understand where the problem comes from…

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