# TCP tunnel between application and device

**URL:** <https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449>\
**Category:** General\
**Created:** [20 January 2021 16:01 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449 "2021-01-20T16:01:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtoko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mtoko/32/138_2.png) [@mtoko](https://discourse.nodered.org/u/mtoko)\
**Post date:** [20 January 2021 16:01 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449/1 "2021-01-20T16:01:56Z")

</div>

Hi

I have an application that communicates using tcp with a device. I would like to send this communication through NR so that I can capture the response from the device to use the information.

I have started with a tcp in node that listens on the required port from the application and I can see a buffer of data coming from the application, this then is sent to a tcp response node that is connected to the device ip and port. The debug nodes show the arriving information and I think there is a reply from the device out of the response node, but how do I send this back to the application?

Advice would be appreciated

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 January 2021 17:31 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449/2 "2021-01-20T17:31:33Z")

</div>

You need another 2 nodes to receive then send the return data.

---

<div class="post-metadata">

**Author:** ![mtoko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mtoko/32/138_2.png) [@mtoko](https://discourse.nodered.org/u/mtoko)\
**Post date:** [20 January 2021 18:25 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449/3 "2021-01-20T18:25:06Z")

</div>

Thanks for the response

I did try something like this, I have connected the output of the tcp request node (which I think is the reply from the device) to a tcp out configured to return the response to the application but the out node does not connect to the application. I assume that the port connection is blocked (used) by the tcp in

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 January 2021 19:53 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449/4 "2021-01-20T19:53:37Z")

</div>

I think we need to know more about the device and how it works, what it does.

---

<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:** [21 March 2021 19:53 UTC](https://discourse.nodered.org/t/tcp-tunnel-between-application-and-device/39449/5 "2021-03-21T19:53:45Z")

</div>

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