get ip express js code example Example: express get remote ip var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;