Error during WebSocket handshake: Unexpected response code: 521

Hello,
I’m trying to get my wws connection via Cloudflare running but unfortunately I’m getting a 521 if I try to connect.

WebSocket connection to ‘wss://DOMAIN.COM:2083/socket.io/?EIO=3&transport=websocket’ failed: Error during WebSocket handshake: Unexpected response code: 521

However my webserver

  • is running
  • doesn’t block the Cloudflare ip.

What can I do?

Are websockets enabled under “Network”?

521 would mean your server is not reachable. Can you post the URL?

1 Like

Thanks for your reply. Yes, it’s enabled.

This is the URL: wss://shout.cabconmodding.com:2083/

This is the website, where I would like to use it: https://cabconmodding.com/shoutbox/

(requires login: shoutbox:123456)

Make sure your service is listening on port 2083.

1 Like

Is listing to 2083.

Maybe you have a firewall entry. If you feel comfortable revealing the IP address you can post it here. Also just temporarily and remove the posting afterwards.

Of the server?
May I send it you private?

Yes, did you check any firewalls?

I wrote my hoster and he wrote back that they do not block any IP addresses.

Thanks for your message.

This is strange. I’m using a NodeJS Plesk add-on to start my app.js script from a shoutbox add-on. In the config of this I entered the correct port.

Do you recommend to do?

Debug your code and configuration and check why it does not listen on that port. You can use netstat for example.

1 Like

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