Skip to content
This repository

canot get local ip? #147

Closed
l5oo00 opened this Issue March 11, 2012 · 4 comments

2 participants

l5oo00 Tomasz Janczuk
l5oo00

as the title.

Tomasz Janczuk
Owner

What is the code you are running, what do you expect to see, and what happens instead?

l5oo00

code:
var http = require('http');

http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var k=req.headers['x-forwarded-for'] || req.connection.remoteAddress;
res.end('Hello, world!
'+k+'
'+'test');
}).listen(process.env.PORT);

expect to see:
Hello,world!
127.0.0.1
test

Tomasz Janczuk
Owner

See #94 for solution.

l5oo00

Thank you.

l5oo00 l5oo00 closed this March 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.