0

This question is actually somewhat similar to Get local IP address in node.js, but with one big difference.

On a machine with many different network interfaces (not being all on the same subnet), I will run a node js based application.

I will absolutely have to tell my own IP address to each peer in my first message to them.

According to the routing table, I should now be able to find the right IP-Address which is reachable by my peer.

So... I know how to list all the network interfaces. But it's not enought to find the right one. I need routing information from the os.

How can this be done in a platform-independent way, and if possible without using too much native code.

I've read about https://www.npmjs.com/package/netroute. But I think it's an absolute overkill to install Python only for this.

Community
  • 1
  • 1
Atmocreations
  • 9,923
  • 15
  • 67
  • 102
  • I have no idea what you're asking, but maybe you need a STUN server ? – adeneo Feb 01 '15 at 14:22
  • No. This has nothing to do with STUN. Basically, I need to access the systems routing table in order to be able to decide which of the IPs I have to hand out so that it can reach me by it. – Atmocreations Feb 01 '15 at 14:37

0 Answers0