# N2n node only passing payload?

**URL:** https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267
**Category:** General
**Created:** [19 November 2024 17:28 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267 "2024-11-19T17:28:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)
#### Post date: [19 November 2024 17:28 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/1 "2024-11-19T17:28:00Z")

</div>

I am trying to use the n2n node that @dceejay created quite a few years ago. But it seems that the n2n input node only outputs payload. Here are some code examples:

Input to n2n output node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/feafd1ab7d92c12b4880e54afbe9ef7287ec82b7.png)

but the output from a n2n input node is:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b015eb517cd3c85ae3b15b88250646e77d5335f1.png)

Notice it only outputs the payload entry of the object?

Is there a way to get the whole object?

---

<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: [19 November 2024 22:12 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/2 "2024-11-19T22:12:20Z")

</div>

No. The whole idea of the node was to send as little data as possible between nodes only when needed. It uses udp so everything has to fit in a single data packet.  
Of course you can use a function node in front to generate a payload that contains the original payload plus other properties as you wish.

---

<div class="post-metadata">

### Author: ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)
#### Post date: [26 November 2024 18:49 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/3 "2024-11-26T18:49:47Z")

</div>

Is there a way to set hostip from the sending node-red instance? I have tried a few things and nothing works.

The reason being, if the node-red instance is on a VLAN, then an incorrect hostip is retrieved.

---

<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: [27 November 2024 11:22 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/4 "2024-11-27T11:22:38Z")

</div>

The hostip is set from the incoming packet remote.address - eg - [UDP/datagram sockets | Node.js v23.3.0 Documentation](https://nodejs.org/api/dgram.html#event-message) so is what the socket sees. If you want to pass anything else you would need to add it to the payload I guess.

---

<div class="post-metadata">

### Author: ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)
#### Post date: [27 November 2024 13:21 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/5 "2024-11-27T13:21:09Z")

</div>

Understood. Interesting though, I am getting 169.x.x.x ip address when coming from a server that has a VLAN address. (i.e. adapter.30).

---

<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: [25 February 2025 13:22 UTC](https://discourse.nodered.org/t/n2n-node-only-passing-payload/93267/6 "2025-02-25T13:22:04Z")

</div>

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