sockjs/sockjs-node — pull request #97 by Zarel (2012-11-26 00:30:40+00:00)
Title: Property for the true remote address of a socket

In newer versions of Node.js (or at least 0.8.3 that I tested on), `socket.remoteAddress` is replaced by the address in the `X-Forwarded-For` header, if it exists. This header can be spoofed.

This adds `socket.trueRemoteAddress`, for the true remote address of the socket that won't be replaced by a spoofed IP.

For instance, if a user with IP 192.168.0.101 initiates a connection with the header `X-Forwarded-For: 8.8.8.8`, then `socket.remoteAddress === '8.8.8.8'` and `socket.trueRemoteAddress === '192.168.0.101'`.