Hello, I am having a problem with websocket. Can you help here? I installed rocketchat. I activated the required modules on Apache 2.4. I have defined the proxy rules but the error “failed: Error during WebSocket handshake: Unexpected response code: 400” is received. "
Server Setup Information
- Version of Rocket.Chat Server: rocketchat-12.14.0
- Operating System: Ubuntu 20.04
- DB Replicaset Oplog:
- NodeJS Version: v12.16.3
- MongoDB Version: v4.0.18
- Proxy Definitions
<Proxy *>
Order deny,allow
Allow from all
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /chat 192.168.0.148:3000/chat
ProxyPassReverse /chat 192.168.0.148:3000/chat
<Location /chat>
Order allow,deny
Allow from all
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /var/www/(.*) ws://192.168.0.10:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /var/www/(.*) 192.168.0.10:3000/$1 [P,L]
RocketChat Service Definitions
Rocket Chat Environment
ROOT_URL=“http test.server.com chat”
ERRORS:
WebSocket connection to ‘wss://test.server.com/chat/sockjs/381/fj3jxqqr/websocket’ failed: Error during WebSocket handshake: Unexpected response code: 400