# Unable to send numbers through websockets

**URL:** <https://discourse.nodered.org/t/unable-to-send-numbers-through-websockets/11638>\
**Category:** General\
**Created:** [28 May 2019 14:02 UTC](https://discourse.nodered.org/t/unable-to-send-numbers-through-websockets/11638 "2019-05-28T14:02:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andres](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andres/32/112_2.png) [@Andres](https://discourse.nodered.org/u/Andres)\
**Post date:** [28 May 2019 14:02 UTC](https://discourse.nodered.org/t/unable-to-send-numbers-through-websockets/11638/1 "2019-05-28T14:02:46Z")

</div>

Hello everyone!

I was playing around with websockets and made a simple flow that worked, it consists in receiving every second a timestamp and a button that when is pressed it send th word "prueba" as payload. Then for some reason i changed the payload from "prueba" to "123" and when i press the button it shuts down the WS connection and all across the dashboard the "connection lost" sign pops up, so i'm a little confused by this. What am i doing wrong?

[pastebin to the flow!](https://pastebin.com/fp4CeUXX)

PD: Sorry if this is not the place to ask this kind of questions!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 May 2019 21:25 UTC](https://discourse.nodered.org/t/unable-to-send-numbers-through-websockets/11638/2 "2019-05-28T21:25:49Z")

</div>

you have configured the websocket to send the entire msg object. This affects both in and out - so it is expecting a properly formed msg object to be sent from the browser button click. You are sending number and it is causing it to break. So yes it's a bug as we shouldn't break that badly...  
The easy fix (for now) is to set it to send payload only.

---

<div class="post-metadata">

**Author:** ![Andres](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andres/32/112_2.png) [@Andres](https://discourse.nodered.org/u/Andres)\
**Post date:** [29 May 2019 10:55 UTC](https://discourse.nodered.org/t/unable-to-send-numbers-through-websockets/11638/3 "2019-05-29T10:55:50Z")

</div>

i saw that if i send the value as an object like this:

var value = {"value":123};  
connection.send(JSON.stringify(value));

It works just fine
