Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's $_SERVER['SERVER_ADDR''] in node.js?

Tags:

node.js

How to get the IP address of the machine where the node.js server is running? I've checked process.env. But that doesn't seem to include this variable.

like image 696
Raj Avatar asked Mar 04 '26 17:03

Raj


1 Answers

Your net.createServer() server has an .address() property.

like image 78
Alex K. Avatar answered Mar 07 '26 07:03

Alex K.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!