I'm logging disconnects in my web game. It seems 75% of the sessions are getting disconnected with the code 1001 (normal) and 25% are getting disconnected with the code 1006 (error). https://tools.ietf.org/html/rfc6455
Sometimes on the error reason I see this text:
CloudFlare WebSocket Proxy restarting
But he majority of 1006 disconnects don't give any reason at all. The players just disconnect with no reason at all. This usually happens at 5-30 minutes mark while the player is actively playing the game.
The setup I'm has these:
- Node.js
- Express.js
- Cloudflare
- Digital Ocean
- Docker
- https://github.com/websockets/ws
- SSL
- Nginx timeout = 3600s
- Ping/Pong isAlive = 30s
My question is:
- How can I debug this problem better?
- What are common cases which might be causing this problem?