Can I get the IP of the tcp client?

The tcp server I created in node-redimage ,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

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.

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

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

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.

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 ^^

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 ^^

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