Error during WebSocket handshake: Unexpected response code: 521

websocket

#1

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?


#2

Are websockets enabled under “Network”?

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


#3

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)


#4

Make sure your service is listening on port 2083.


#5

Is listing to 2083.


#6

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.


#7

Of the server?
May I send it you private?


#8

Yes, did you check any firewalls?


#9

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


#12

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?


#13

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


closed #14

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