How to find the ip of another computer in network node.js?

Hello!! The people in short I make nw.js a local game. And to connect to another computer in the program need the ip of the Host! The question is!!!
How can I get all ip address in local network?
I will appreciate anyone who reply☆☆
And izvenyayus for the mistakes I'm not Russian!
March 19th 20 at 08:55
1 answer
March 19th 20 at 08:57
The wrong way is to take the address and netmask (from them one can calculate all possible addresses) and scan your network, find working computers.
Correct - one host needs to send to the local network broadcast with a certain interval, and the other to listen and to show the game.
Simple - to-local address on the second computer and display it to the user, the user will just tell it to the other player and he would bring his hands.
Thank you! Hands like don't want! Broadcast can be about this in more detail? As Poneman is there another way to find a host? - Davin commented on March 19th 20 at 09:00
Broadcast is the sending of messages from all computers in the network. Therefore, the exact address do not need to know.
And when this message will reach the other computer - it is already it will take the address of the person who sent and will contact you directly.
Details of how to do it - Google. Message is sent on the broadcast address for home networks is usually the .255 at the end, but it could be more. You may still need to do it for UDP. - berenice_Huels commented on March 19th 20 at 09:03
@berenice_Huels, thank you very much - Davin commented on March 19th 20 at 09:06

Find more questions by tags Node.jsIP