1

I am unable to connect to socketcluster server from Firefox and chrome for android. Is there any solution?

user1762608
  • 245
  • 2
  • 4
  • 10

1 Answers1

1

The 'Socket hung up' error can mean either: The server was disconnected abruptly (e.g. the connection was lost for whatever reason). OR the client could not find the target server while trying to connect - It could be because the wrong arguments were passed to the client (E.g. don't match the server host, port, ...) or a network connection issue.

Are you trying to connect over 3G? Some 3G ISPs and some corporate networks block raw WebSocket traffic. If that's the case, the solution is to serve SocketCluster over wss:// - Proxies won't be able to block it if the connection is encrypted.

To make it work, you just need to provide a TLS key and certificate to the main SocketCluster constructor. Or you can put the raw SC server behind a TLS-enabled load balancer like AWS CloudFront, CloudFlare or similar (make sure it supports proxying WebSocket traffic).

Jon
  • 1,224
  • 2
  • 14
  • 23