WebSockets can be easly enabled at Cloudflare dashboard for your domain name with a single click, therefrom it’s not a paying subscription service. Free of charge to use with your domain name having proxied DNS records.
If you’re using a Cloudflare Worker with combination with WebSockets:
Websockets close with the error 1006 when this occurs. Furthermore related to the restarting/retry, error 1001 so both sides (client and origin server) are aware that the WebSocket termination is only a transient event, and that they can expect to immediately re-establish a connection again on retry.
Regarding server restarts, Cloudflare does not publish a schedule for code deployments that may restart servers. However, Cloudflare’s architecture is designed for high availability, so such events should be infrequent.
The solution is just to make sure you have reconnect logic. Users being disconnected due to Cloudflare or general network problems isn’t uncommon.
I’m not sure there’s really better advice than just make sure you have reconnect logic implemented in your code/application.