senchalabs/connect — pull request #684 by natesilva (2012-11-02 23:11:21+00:00)
Title: log the IP address as seen by Express, if available

Currently, the `connect.logger` middleware logs the socket’s IP address.

Instead, it should prefer to log `req.ip`—the IP address as seen by Express. This is especially useful when the Express’ “trust proxy” option is enabled. In that case, it will log the *user’s* IP address, and not the proxy’s IP address.

If not using a proxy, or if `req.ip` is not available (for example, you’re not using Express), it will log the immediate IP address, as before.