Web socket 404 error when deployed

Hey noob question, but I'm getting 404 or 520 error when trying to establish a web socket connection from Cloudflare Worker. This only happen when the worker is deployed & not locally. Is this an issue with the origin server blocking connection from Cloudflare network? The origin server is fly.io btw, and I've also posted a support thread there: https://community.fly.io/t/websocket-connection-cant-be-established-from-cloudflare-worker/18489
2 Replies
Painguin
PainguinOP10mo ago
Like when running wrangler dev, this work perfectly fine in local mode but as soon as I turn local mode off I'll get the 404 error. So could be an issue specifically with cloudflare Tested from several other application including Postman WS, and this problem is exclusive to "deployed" cloudflare worker My application is running on port 8182 which I've explicitly specified in the url new WebSocket('wss://someurl.com:8182/somepath'). There's also a normal http webapp running on port 80. Seems like there's a major bug with the worker ignoring the port number and use 80 instead, resulting a 404 error. This is only true for deployed worker.
Painguin
PainguinOP10mo ago
This is definitely a bug with the worker runtime so have created this GH issue here: https://github.com/cloudflare/workerd/issues/1751
GitHub
🐛 Bug Report — Runtime APIs WebSocket can't connect to remote ser...
Behaviour When connecting to a remote web socket server running on a custom port. Cloudflare worker will first try to use port 80 instead of the one specified in the URL, resulting in the following...
Want results from more Discord servers?
Add your server