Livechat could not connect to websocket


I’ve enabled Omnichannel in my installation, I installed livechat on my application using the javascript provided. It works, the application is loading the livechat and I can send a message, it’s being received on the omnichannel and an agent can send a reply. The only problem is the livechat on the application could not connect to the websocket so it’s not receiving real time replies, if the page is refreshed that’s that only time the user can see the agent’s reply.

On chrome dev tools i’m getting an error,

Websocket connection to ‘ws://localip:3000//websocket’ failed: Connection closed before receiving a handshake response

Tried while using nginx and tried without it, still the same result.

Server Setup Information

  • Version of Rocket.Chat Server: 3.6.0
  • Operating System: CentOS 7
  • Deployment Method: manual installation
  • Number of Running Instances: 1
  • DB Replicaset Oplog: On
  • NodeJS Version: 12.16.1
  • MongoDB Version: 4.0.20
  • Proxy: nginx/none
  • Firewalls involved: none? all related ports afaik are opened

Any additional Information

Solved my problem, turns out the livechat is using the siteurl to determine the websocket connection. I setup my site URL in general settings as ‘http://localip:3000/’, notice the slash at the end of the URL, the docs also contain an example like this. The livechat however is inserting its own slash at the websocket URL that’s why I was getting a ‘ws://localip:3000//websocket’ address, notice the 2 slahes.

I have same problem, but I do not understand what should I have in the config file, in the rocket chat settings and in Drupal 8 settings?