-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x-forwarded-port not being set correctly... maybe #341
Comments
+1 Say my node server is running on 3000 and is proxied by node-http-proxy on 3001. I have tested @Blahed's patch and it works for me. |
`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 http-party#341 & http-party#227
Hello! I'm just coming across this now. I was wondering if there was a planned resolution, or something I missed? Installing node v0.10.23 and node-http-proxy 0.10.3 shows the same behavior for me. Edit: The caronte branch exhibits this behavior as well. |
@fideloper fixed in 97e4600 :) |
Awesome, thanks! |
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
The text was updated successfully, but these errors were encountered: