Websockets on node js server proxied with a cname record

I want to make a api with my node js server with is connected via a cname record to my domain.
normal endpoints like get and post are working perfectly fine.

Now i want to add a websocket endpoint in my code.
I use node js and tried fastify and express but with both libs i get error 504 (gateway timeout)

How can i fix this?

Likely impossible due to this

Unlikely to happen as well. Read below thread

1 Like

normal api requests are working though (post and get) cause i am using my own server (node js) and used a cname record to my domain and proxied it…

shouldnt websockets also work then?

What do you mean with “proxied it”?

As I understand it, you have a site that’s hosted with us, and a subdomain of that site’s domain is pointing to a Node.js server hosted elsewhere. You’re trying to setup a websocket connection from somewhere (I assume it’s a browser, but it’s not clear to me where and how exactly).

If my understanding is correct, then there isn’t a lot we can do for you. We don’t host the websocket server and the client code doesn’t run on our servers, so our hosting doesn’t really matter in this issue. The only thing we could have any influence over is the CNAME record if you’re using our nameservers.

A Gateway Timeout error sounds like the proxy you’re using is unable to connect to the websocket server. But the reason for that could be anything, and nobody here is actually capable for checking anything for you.

If you want help from somewhere, I think your best place to start is to go through the support channels of the hosting provider that hosts your websocket server. The service that’s having problems is hosted with them, after all.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.