Issues with WebSockets over custom port?


#1

Has anyone used a non-80 port with WebSockets enabled successfully?

I have verified that my WebSockets server is listening on an HTTP port supported by CloudFlare (per this knowledgebase article: https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-Cloudflare-work-with-) but after debugging, it seems as though the Upgrade header is not passed to my WebSockets server when CloudFlare is enabled.


#2

WebSockets should work across all ports we support, though we typically recommend sticking to 80, 8080, 443 and 8443 due some exceptions.

  • What port are you attempting to use with WebSockets in this case?
  • What is the use case for supporting WebSockets on an alternative port?

#3

Thanks for the reply!

Ports in use are 8080 and 2082; the use case is multiple WebSockets servers are open and listening, but I’m figuring that I can use nginx to proxy specific paths to the open ports instead (over 80).

It’s just odd to me that the Upgrade header wouldn’t be passed through with CloudFlare enabled. Thoughts/suggestions?


#4

Update: I moved one of the WebSockets servers to port 80 and it’s still not passing the header or successfully switching protocols to WebSockets.


#5

Never mind; I can’t believe I missed this. :joy:

Thanks!