Anastasia  Sisordia Anastasia Sisordia - 1 year ago 164
Node.js Question

How to get IP adress in node.js

How in node.js I can get the IP adress of my server?

I need know this ip for conection with my server, but I dont know where I can see this ip adress(

Answer Source

On Windows, go to console window and type ipconfig. You should get a listing that will have a section like this in it:

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::7533:a40e:4362:5c49%4
   IPv4 Address. . . . . . . . . . . :      <=== This is it
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :

That is the IP address of your computer on your local LAN and can be used to reach it from within your local LAN.

This a dynamically assigned IP address. It can change from time to time, though will typically stay the same for long periods of time.

If you want to reach it from the internet, that is more complicated as you will need the public IP address of your internet connection and will need to set up port forwarding in your router.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download