determine x-forwarded-port from host header

`req.remotePort' returns the ephemeral port, which is not useful.
node v0.10.0 added `req.localPort' which returns what we want, but
we want to maintain backwards compatibility. Fixes #341 & #227
[fix] Optimize fix for `x-forwarded-for-port`.