Livechat show 502 WebSocket is already in CLOSING or CLOSED state

Description

I install live code on the webpage, it does work right.

  1. The live chat button show up late.
  2. The live chat window doesn’t show the replay, I need to refresh the page to check live chat again to see the reply.(sometimes they just keep blank)
  3. The first word input from the webpage frontend stay in English letter, if my visiter input the Chinese, then it will be confused by this.

I have inspected the code from Chrome, there are errors showing
“Rocket.Chat.js.SDK.chunk.77365.js:1 WebSocket is already in CLOSING or CLOSED state.”
and
"Rocket.Chat.js.SDK.chunk.77365.js:1 WebSocket connection to ‘wss://myrocketchatdomain:1234//websocket’ failed: Error during WebSocket handshake: Unexpected response code: 502

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System: 2.4.9
  • Deployment Method: docker
  • Number of Running Instances:
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version: 4.2
  • Proxy: nginx
  • Firewalls involved:

Any additional Information

Hi. You got the solution?

Hi Patrick.

Are you facing this kind of error?

This is usually caused by a wrong configuration. Try setting the domain of in Allowed Domains in Settings > Omnichannel > Livechat

Let me know if this helps.