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.