Change to req.ip

This commit is contained in:
Alex Janka 2017-06-02 22:28:19 +10:00
parent 8b9691faca
commit c8d88b2f5b

View file

@ -12,9 +12,10 @@ var cache = new HashMap();
app.engine('handlebars', expresshb({ defaultLayout: 'main' })); app.engine('handlebars', expresshb({ defaultLayout: 'main' }));
app.set('view engine', 'handlebars'); app.set('view engine', 'handlebars');
app.enable('trust-proxy');
app.get('/', function (req, res) { app.get('/', function (req, res) {
getIpInfo("::ffff:" + "119.17.156.106").done(function (geoinfo: IPGeoJson) { getIpInfo(req.ip).done(function (geoinfo: IPGeoJson) {
res.render('home', { res.render('home', {
helpers: { helpers: {
ip: function () { return geoinfo.ip; }, ip: function () { return geoinfo.ip; },