A
A
Aziz Soliyev2019-03-27 23:01:23
Node.js
Aziz Soliyev, 2019-03-27 23:01:23

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

Hello!! In short, I'm making a local game on nw.js. And in order to connect to another computer in the program, you need the Host's ip! The question is this!!!
How can I get all ip addresses on a local network?
I will be glad to everyone who will answer☆☆
And I apologize for the mistakes, I'm not Russian!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-03-28
@Robur

The wrong way is to take an address and a netmask (from which you can easily calculate all possible addresses) and scan the network, finding working computers.
Correct - one host should send a broadcast to the local network at a certain interval, and the other should listen and show the found game.
Simple - get a local address on the second computer and display it to the user, the user will simply tell it to another player and he will enter it manually.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question