x-forwarded-port not being set correctly... maybe
Created by: trvsdnn
My understanding is that x-forwarded-port should be set to the server port that the request came in on: 80, 443, etc.
If that's the case, it's not happening. req.connection.remotePort
is the requesting client's remote port. I didn't see an obvious way to get the server from the request, but it seems easy enough to determine it from the host header/protocol.
Assuming I'm understanding x-forwarded-port correctly, I've got a branch that fixes the issue here:
https://github.com/blahed/node-http-proxy/compare/x-forwarded-port