# how can I connect an existing tcp connection on node-red with a java application through a JSON file

**URL:** <https://discourse.nodered.org/t/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application-through-a-json-file/169>\
**Category:** General\
**Created:** [14 May 2018 22:12 UTC](https://discourse.nodered.org/t/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application-through-a-json-file/169 "2018-05-14T22:12:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lina](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@lina](https://discourse.nodered.org/u/lina)\
**Post date:** [14 May 2018 22:12 UTC](https://discourse.nodered.org/t/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application-through-a-json-file/169/1 "2018-05-14T22:12:24Z")

</div>

hello.  
how can I connect an existing tcp connection on node-red with a java application through a JSON file?

I have a tcp connection on node-red and I want the info that I get there to be exported as a Json file that a Java application can read, any idea would be helful.

---

<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:** [15 May 2018 16:34 UTC](https://discourse.nodered.org/t/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application-through-a-json-file/169/2 "2018-05-15T16:34:47Z")

</div>

Not sure exactly what you mean… as in what exactly you want to write to the file… but if you just want the payload - then just connect it to a file out node and configure that with a path and filename (if you want a fixed one to monitor) and see what happens.

Of course you may need to convert the payload in some way first - but you haven’t mentioned that.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [16 May 2018 14:41 UTC](https://discourse.nodered.org/t/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application-through-a-json-file/169/3 "2018-05-16T14:41:49Z")

</div>

Note that this question has also been asked on StackOverflow:  
[https://stackoverflow.com/questions/50336106/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application](https://stackoverflow.com/questions/50336106/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application)
