I have the following very simple HTTP server code that listens on port 8000. How can I determine the IP address of a server, can I get it from the "server" variable? I am working on an application where I need to automatically send the Info server (ip, port, etc.) to redis store.
I'm new to node.js, thanks for the help
var http = require("http"); var server = http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/html"}); response.write("Hello!!!"); response.end(); });
server.listen(8000); console.log("Server is listening....");
Sohaib
source share