# Rasa chat widget and occational issues with the websocket connection

**URL:** <https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325>\
**Category:** Rasa Open Source\
**Created:** [May 17, 2023, 11:03am UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325 "2023-05-17T11:03:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScienceGuy](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@ScienceGuy](https://forum.rasa.com/u/ScienceGuy)\
**Post date:** [May 17, 2023, 11:03am UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325/1 "2023-05-17T11:03:48Z")

</div>

I have a **Angular** project that embedds the official Rasa widget in one page. The site uses Nginx as a reverse proxy to forward requests to a Rasa Docker container, and I use Rasa’s socketio channel for the communication. The widget also uses the “data-initial-payload” parameter to trigger the bot - it will respond with three messages.

When I use the widget I experience unstable behavior. There are these three cases what can happen:

- The widget works as as expected, i.e., the three initial messages appear and I can chat with the bot.
- One or two of the three messages appear and I can chat with the bot.
- No message appears and I cannot chat.

In the last case, the browser indicates that it cannot create a websocket connection. This is the error that I see:

```auto
WebSocket connection to 'ws://hostabcd/aa/socket.io/?EIO=4&transport=websocket&sid=j4L50ULhQQuLOUeUAAAi' failed: Error during WebSocket handshake: Unexpected response code: 200

```

Does anyone have ideas why this happens or has similar experiences?

---

<div class="post-metadata">

**Author:** ![ScienceGuy](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@ScienceGuy](https://forum.rasa.com/u/ScienceGuy)\
**Post date:** [May 18, 2023, 11:17am UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325/2 "2023-05-18T11:17:53Z")

</div>

Turned out to be a forwarding issuerelated to the domain.

---

<div class="post-metadata">

**Author:** ![BelenAleman](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/belenaleman/32/13902_2.png) [@BelenAleman](https://forum.rasa.com/u/BelenAleman)\
**Post date:** [March 27, 2024, 5:39pm UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325/3 "2024-03-27T17:39:38Z")

</div>

Hello,

I am experiencing the same issue. What did you modify in in the domain to solve it?

Thank you so much.

---

<div class="post-metadata">

**Author:** ![ScienceGuy](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@ScienceGuy](https://forum.rasa.com/u/ScienceGuy)\
**Post date:** [March 28, 2024, 9:59am UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325/4 "2024-03-28T09:59:07Z")

</div>

Hi, in my case we had two reverse proxies in a row and the first one did not have the right configuration to accept the websocket connections.

---

<div class="post-metadata">

**Author:** ![BelenAleman](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/belenaleman/32/13902_2.png) [@BelenAleman](https://forum.rasa.com/u/BelenAleman)\
**Post date:** [April 1, 2024, 8:57am UTC](https://forum.rasa.com/t/rasa-chat-widget-and-occational-issues-with-the-websocket-connection/58325/5 "2024-04-01T08:57:35Z")

</div>

Thanks for your help!
