# How to send websoecket message from the backend in rust?

**URL:** <https://forum.dfinity.org/t/how-to-send-websoecket-message-from-the-backend-in-rust/22509>\
**Category:** Developers\
**Tags:** Discussing\
**Created:** [September 2, 2023, 11:05pm UTC](https://forum.dfinity.org/t/how-to-send-websoecket-message-from-the-backend-in-rust/22509 "2023-09-02T23:05:01Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ilbert](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ilbert/32/8717_2.png) [@ilbert](https://forum.dfinity.org/u/ilbert)\
**Post date:** [September 11, 2023, 8:02am UTC](https://forum.dfinity.org/t/how-to-send-websoecket-message-from-the-backend-in-rust/22509/6 "2023-09-11T08:02:27Z")

</div>

That’s what for us seems to be a bug. Reinstalling the canister may solve the issue, as I mentioned here:

> [@How to send a message in WebSockets electric\_plug on the Internet Computer](https://forum.dfinity.org/t/how-to-send-a-message-in-websockets-on-the-internet-computer/22574/2):
>
> It’s great that you tried our tutorial! This is something that shouldn’t happen. Every time a new client connects, the on\_open callback is called by the CDK on the canister. If this doesn’t happen, it means that the connection is still not fully established. This appears to be a bug, that we also have encountered and that we’re fixing. As a temporary workaround, [reinstalling the canister](https://internetcomputer.org/docs/current/developer-docs/setup/manage-canisters#reinstall-a-canister) should fix it (but you’re going to loose all the canister data, so be careful!). We’re working on a more r…

Have you tried it?

On the frontend client, are you getting any errors? Are you getting this sequence of log messages in the console?

```plaintext
[init] Generating new secret key
[onWsOpen] WebSocket opened, sending first service message
[onWsOpen] First service message sent
[onWsMessage] First service message received

```

---

_[View the full topic](https://forum.dfinity.org/t/how-to-send-websoecket-message-from-the-backend-in-rust/22509)._
