Print origin ip address when the user is behind a proxy.

This commit is contained in:
Ophir LOJKINE 2013-11-14 20:56:56 +01:00
parent 134a017095
commit bcc2bcfcac
2 changed files with 3 additions and 2 deletions

View file

@ -3,7 +3,7 @@
"collaborative",
"whiteboard"
],
"version": "0.1.0-19",
"version": "0.1.0-20",
"dependencies": {
"node-static": "0.7.x",
"socket.io": "0.9.x"

View file

@ -32,7 +32,8 @@ function serveError(request, response, err) {
}
function logRequest (request) {
console.log(Date() + " : Connection from " + request.connection.remoteAddress +
var ip = request.headers['X-Forwarded-For'] || request.connection.remoteAddress;
console.log(Date() + " : Connection from " + ip +
" ("+request.headers['user-agent']+")");
}