WebSocket requires the connection:upgrade header, but your server is sending connection: close. This usually happens because Nginx or Passenger is not set up to support WebSockets. The .htaccess file only works with Apache and does not support WebSocket connections or upgrades. Try change the main server (like Nginx or Passenger) config to allow WebSockets. In shared hosting, you usually cannot do this yourself. Moving to a host that supports WebSockets, or use an external service for real-time communication.