WebSocket traffic not being forwarded properly

Hey Cloudflare!

I’m using a third-party program Glitch to host my node.js 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 on Glitch I have moved my nameservers to Cloudflare 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? I’m fairly certain it is not on Glitch’s end since everything works fine when using the non-routed/non-proxied site.


This topic was automatically closed after 14 days. New replies are no longer allowed.