# Can I get the IP of the tcp client?

**URL:** <https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698>\
**Category:** General\
**Created:** [12 April 2020 12:58 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698 "2020-04-12T12:58:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![KOUKILEO](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@KOUKILEO](https://discourse.nodered.org/u/KOUKILEO)\
**Post date:** [12 April 2020 12:58 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/1 "2020-04-12T12:58:59Z")

</div>

The tcp server I created in node-red ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a55f7340a86c36e1c1ae1425fd21b3537e7b5b06.png) ,But I have many clients,!  
Is there a way to find the IP of each connected customer?  
So that I can choose one of the clients to send messages, not everyone !  
I want to achieve this kind of function in the youtube.

  
Can someone help me?Thank you  
My English is not good,f someone can speak Chinese, you can also use Chinese to communicate with me.  
I am new to the forum, if there is something wrong, sorry

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 April 2020 13:01 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/2 "2020-04-12T13:01:30Z")

</div>

> [@KOUKILEO](#):
>
> I have many clients,  
> Is there a way to find the IP of each connected customer?

Try connecting a debug node to the TCP in node (set Show complete message option on the debug node). Then look in the debug output (expand the debug msg) I think you might get IP of sender.

---

<div class="post-metadata">

**Author:** ![KOUKILEO](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@KOUKILEO](https://discourse.nodered.org/u/KOUKILEO)\
**Post date:** [12 April 2020 13:06 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/3 "2020-04-12T13:06:43Z")

</div>

Thank you for your help, but the client must send the value to the server to get the IP and PORT, if the client simply connects it will not get IP andPORT

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 April 2020 13:29 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/4 "2020-04-12T13:29:16Z")

</div>

If you create the client then you could send the IP upon connection as part of that program.

Are you certain it is not enough to use the IP provided by the TCP In node?

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

---

<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:** [12 April 2020 15:33 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/5 "2020-04-12T15:33:20Z")

</div>

Also as long as the \_session property you see there is still attached then the tcp out node in replyTo mode will ONLY send the outgoing message back to that \_session (so no need to know the IP apart from for interest). If you remove/delete the \_session property then the outgoing message will go to all connected clients.

---

<div class="post-metadata">

**Author:** ![KOUKILEO](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@KOUKILEO](https://discourse.nodered.org/u/KOUKILEO)\
**Post date:** [14 April 2020 13:20 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/6 "2020-04-14T13:20:24Z")

</div>

Thank you for your help. I have been busy recently. I will try your methods again when I have time. At present, I am reminded of some solutions. Thank you very much.  
Sorry for replying later,  
If I encounter difficulties, I will ask you again ^^

---

<div class="post-metadata">

**Author:** ![KOUKILEO](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@KOUKILEO](https://discourse.nodered.org/u/KOUKILEO)\
**Post date:** [14 April 2020 13:21 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/7 "2020-04-14T13:21:00Z")

</div>

Thank you for your help. I have been busy recently. I will try your methods again when I have time. At present, I am reminded of some solutions. Thank you very much.  
Sorry for replying later,Thank you for your help  
If I encounter difficulties, I will ask you again ^^

---

<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:** [13 June 2020 13:21 UTC](https://discourse.nodered.org/t/can-i-get-the-ip-of-the-tcp-client/24698/8 "2020-06-13T13:21:13Z")

</div>

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