Speed up development with full-stack environments for every branch.

Learn More

Express Clien IP [Node.js and Client]

Forked from Hello World in Express.

17 Runs 36 Views 2 Copies
Saved

Saved

norbertscehura 1

norbertscehura
published 2 months ago

var express = require('express');
var app = express();

app.get('/', function(req, res) {
  var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
  res.send('Your ip: ' + ip);
});

app.listen(80);
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).