mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
Print origin ip address when the user is behind a proxy.
This commit is contained in:
parent
134a017095
commit
bcc2bcfcac
2 changed files with 3 additions and 2 deletions
|
@ -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"
|
||||
|
|
|
@ -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']+")");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue