How to find out which IP / host the client is connecting to in node.js TCP Server?
var server = net.createServer(function (stream) { // The server is behind a firewall, // how can I know how the client connect to this server? console.log(stream.localAddress); }); server.listen(21, '0.0.0.0');
thanks
Got ans: we can use stream.address () to get the port and connect the client to the client.