Getting 192.168.1.xx server address from inside Meteor App


#1

My App will run LAN-wide with non-fixed IP address. I would like to be able to click a button to get the LAN IP Address so other clients can easily find the address and enter it in their client. Using httpHeaders initially reports 127.0.0.1, its not until a remote client connects that it reports 192.168.1.xx, but I want the info so that remote client can connect…
Any ideas??


#2

maybe use a system-call or a npm library like https://www.npmjs.com/package/ip that reports the ip-adress of the system.

But why not assining the server a fixed ip adress? You can also add a reservation on the dhcp-server for your server.


#3

@macrozone Thanks Marco. This is convenience function for many LAN installations. Absent the easy solution I was hoping for I will look to do it properly with a Service Discovery Protocol. cheers.