I’m using Glitch to host my project which heavily relies on the use of WebSockets. My server is an HTTP server, but it seems like glitch is running a HTTPS server which is proxying the requests to my server, effectively allowing my server to deal with HTTP requests while the client can still communicate via HTTPS and WSS respectively.
I have purchased a domain, and connected my project to this domain. I have moved my nameservers to Cloudflare (although I’m not quite sure this is still necessary) and enabled the Full SSL mode (“Encrypts end-to-end, using a self signed certificate on the server”). Now, I can reach my site via HTTPS and WSS using my glitch link (example.glitch.me), and all works well. From my custom domain (which is routed through Cloudflare), I can still reach my website via HTTPS, however I am unable to establish any WebSocket connection to the server. The requests just don’t complete.
I can see on the server side that I’m receiving socket connections in both cases, but the client seems unaware when using the application from my custom domain + Cloudflare website. How can I fix this? Is this a problem with Cloudflare? Does glitch even support WebSockets with custom domains?