JedWatson/keystone — pull request #248 by crimeminister (2014-03-20 19:32:02+00:00)
Title: Feature/express trust proxy

It turns out I need to enable the Express 'trust proxy' setting to correctly discover the originating IP address when deploying to a cloud hosting provider. This PR adds the following snippet to the Keystone app initialization; if the user sets 'trust proxy' when calling ```keystone.init()``` then the underlying Express setting is enabled.

```javascript
// Process X-Forwarded-For request header

if (this.get('trust proxy') === true) {
app.enable('trust proxy');
} else {
app.disable('trust proxy');
}
```
There is also an addition to the documentation 'configuration' page.

Unfortunately this PR also includes a large number of whitespace modifications; my IDE is set to auto-trim all trailing whitespace to try and avoid spurious version control diffs. Things don't always work out the way I'd like… Holler if you'd like this reworked to avoid the whitespace changes, s.v.p.

Cheers!