# Websocket disconnection problem

**URL:** <https://discourse.nodered.org/t/websocket-disconnection-problem/95646>\
**Category:** General\
**Created:** [25 February 2025 19:00 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646 "2025-02-25T19:00:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeromeVISUALS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeromevisuals/32/40103_2.png) [@JeromeVISUALS](https://discourse.nodered.org/u/JeromeVISUALS)\
**Post date:** [25 February 2025 19:00 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/1 "2025-02-25T19:00:12Z")

</div>

Hi there,

I try to use Websocket to connect to an external device and receive information, it's all working quite good, but I get WS disconnection every 30 sec, even if I set correctly (at least I guess I do) keepAlive messages according to the product documentation.  
Not sure if I should investigate on the device itself, or in my code.

Wondering if some of you have any problems with the stock WS nodes (not sure if any other available), or can give me some clues about where I should focus on to solve this problem .

Thanks !

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [25 February 2025 19:32 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/2 "2025-02-25T19:32:40Z")

</div>

Analyse messages over socket in terms of the size.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2025 20:04 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/3 "2025-02-25T20:04:45Z")

</div>

Also check in the node red log that there is not something else going on (node red crashing for example).

---

<div class="post-metadata">

**Author:** ![JeromeVISUALS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeromevisuals/32/40103_2.png) [@JeromeVISUALS](https://discourse.nodered.org/u/JeromeVISUALS)\
**Post date:** [26 February 2025 19:59 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/4 "2025-02-26T19:59:58Z")

</div>

Thanks, but what do you mean exactly ? Over wireshark ?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [26 February 2025 21:31 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/5 "2025-02-26T21:31:13Z")

</div>

You should be able to see ws traffic with browser developer tool. The size and frequency of messages may play critical role.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 May 2025 21:31 UTC](https://discourse.nodered.org/t/websocket-disconnection-problem/95646/6 "2025-05-27T21:31:27Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
