# Livechat show 502 WebSocket is already in CLOSING or CLOSED state

**URL:** <https://forums.rocket.chat/t/livechat-show-502-websocket-is-already-in-closing-or-closed-state/6077>\
**Category:** Community Support\
**Created:** [March 14, 2020, 3:07pm UTC](https://forums.rocket.chat/t/livechat-show-502-websocket-is-already-in-closing-or-closed-state/6077 "2020-03-14T15:07:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![free521](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/free521/32/1561_2.png) [@free521](https://forums.rocket.chat/u/free521)\
**Post date:** [March 14, 2020, 3:07pm UTC](https://forums.rocket.chat/t/livechat-show-502-websocket-is-already-in-closing-or-closed-state/6077/1 "2020-03-14T15:07:22Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![patrick.coelho](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@patrick.coelho](https://forums.rocket.chat/u/patrick.coelho)\
**Post date:** [August 18, 2022, 7:49pm UTC](https://forums.rocket.chat/t/livechat-show-502-websocket-is-already-in-closing-or-closed-state/6077/2 "2022-08-18T19:49:24Z")

</div>

Hi. You got the solution?

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [August 22, 2022, 8:22pm UTC](https://forums.rocket.chat/t/livechat-show-502-websocket-is-already-in-closing-or-closed-state/6077/3 "2022-08-22T20:22:15Z")

</div>

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.
