What is the name of the domain?
erp.example.app
What is the error message?
WebSocket connection to ‘wss://erp.example.app/socket.io/?EIO=4&transport=websocket&sid=KQgMBEv2Fj-5fQM0AAAW’ failed: WebSocket is closed before the connection is established.
What is the issue you’re encountering
I am using Cloudflare to proxy my ERPNext/Frappe server, and when Cloudflare proxy is enabled, WebSocket (Socket.IO) fails to connect. The error message shows that the WebSocket is closed before the connection can be established.
What steps have you taken to resolve the issue?
I have tried switching Cloudflare to “DNS only” mode, which resolves the WebSocket issue. However, I want to keep Cloudflare proxy enabled for security and firewall protection while allowing Socket.IO to function properly.
What feature, service or problem is this related to?
DNS records
What are the steps to reproduce the issue?
1- Set up Cloudflare proxy for the domain.
2- Try to connect to the WebSocket (wss://erp.example.app/socket.io/).
3- Observe the error that occurs: “WebSocket is closed before the connection is established.”