Simple NPM to know your user's IP Address
(This Requires Node 4.x or Later...)
npm install user-ip --save
userIP(req)
req
- REQUIRED: http/https server request object
'use strict';
const http = require('http');
const userIP = require('user-ip');
http.createServer(function (req, res) {
const ip = userIP(req);
res.end(ip);
}).listen(3000);
Thank You!