# Getting session of TCP Connection without direct connection to the node

**URL:** <https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452>\
**Category:** General\
**Created:** [29 November 2021 12:36 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452 "2021-11-29T12:36:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianOvesen](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@ChristianOvesen](https://discourse.nodered.org/u/ChristianOvesen)\
**Post date:** [29 November 2021 12:36 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/1 "2021-11-29T12:36:10Z")

</div>

Hello, I am fairly new to node-red and I have run into an issue. So I have a TCP connection that sends nothing until it has received an initiation message, then it will begin sending constantly and won't need other messages.

So it's a basic TCP IN connection except for that start message. Problem is, I cannot trigger the sending cause after I establish a TCP connection it sends nothing and therefore won't trigger other nodes. I set up a status node that triggers a function node which then is connected to a TCP out with a reply, however, I do not know how to provide the function node with the proper TCP session. Does anyone know how this can be achieved?

---

<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:** [29 November 2021 13:36 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/2 "2021-11-29T13:36:46Z")

</div>

Maybe a tcp-request node set to never close the session ?  
If you are listening for a connection instead, then I don't think you need to use the exact session as by default any message should get sent to all sessions.

---

<div class="post-metadata">

**Author:** ![ChristianOvesen](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@ChristianOvesen](https://discourse.nodered.org/u/ChristianOvesen)\
**Post date:** [29 November 2021 13:55 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/3 "2021-11-29T13:55:29Z")

</div>

This sadly does not work, if I use a tcp request node it gets an error with failed to connect, but a normal tcp in node establishes a connection perfectly fine. However as soon as I trigger any reply it seems to disconnect me

It may be worth stating that my goal here is to emulate an ssl socket connection

---

<div class="post-metadata">

**Author:** ![ChristianOvesen](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@ChristianOvesen](https://discourse.nodered.org/u/ChristianOvesen)\
**Post date:** [30 November 2021 07:26 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/4 "2021-11-30T07:26:07Z")

</div>

Interestingly, I see now that it fails to connect when I send a message cause of "TLS handshake failed: handshake failed: wrong version number", is there a way I can set the tls version for node red to use? It should be 1.2

---

<div class="post-metadata">

**Author:** ![ChristianOvesen](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@ChristianOvesen](https://discourse.nodered.org/u/ChristianOvesen)\
**Post date:** [2 December 2021 07:35 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/5 "2021-12-02T07:35:50Z")

</div>

So I made a script instead to make the connection instead of node red and I think I know what the issue is, the tcp connection must also use ssl, I cannot see any way in node red to set my tcp nodes to use ssl but maybe I am missing something?

---

<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:** [31 January 2022 07:36 UTC](https://discourse.nodered.org/t/getting-session-of-tcp-connection-without-direct-connection-to-the-node/54452/6 "2022-01-31T07:36:09Z")

</div>

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