sockjs/sockjs-node — Issue #25: Generalize connection.remoteAddress
Author: majek
Created: 2011-10-21 09:41:23+00:00
State: open

In 296a921a295e031827549ed89f4a755eab24429d we introduced `connection.remoteAddress`. This kind of makes sense in a context of a web server exposed to the internet, but `SockJS` should work fine behind a proxy.

In such case `connection.remoteAddress` would be useless.

We should expose `X-Forwarded-For` in similar matter (for example take a look at [haproxy config](http://haproxy.1wt.eu/download/1.4/doc/configuration.txt)).

Also proxies (squid?) usually add some magical header (is it `x-forwarded-for`?).

Maybe `connection.remoteAddress` should be list? But that introduces a potential security risk - what if user is able to add arbitrary `x-forwarded-for` (think: ajax) and the application is looking only at the last IP number in the list.

What other frameworks are dealing with that?