[Misc]: X-Forwarded-For header
jonaro00 opened this issue ยท 5 comments
X-Forwarded-For header enables getting the remote IP in proxied HTTP requests.
There might be even more proxy headers that are relevant to set, such as X-Forwarded-Proto https://discord.com/channels/803236282088161321/1178078233544097862
This issue is a part of the Product Feature Poll (all issues). React with ๐ if you want this feature. Comment if you have suggestions related to this feature.
What has to be done exactly on this? Sorry but I did not fully understand reading the Discord chats
The Shuttle team will work on this in due time after upcoming changes to the proxy.
I think this is fixed?
Shuttle calls hyper_reverse_proxy::ReverseProxy::call
here which internally handles adding the X-Forwarded-For
if it doesn't exist here. The first argument to the call
method is the client's IP to use for this.
I don't think it sets X-Forwarded-Proto
so maybe that is why this issue is still open?
I think this is fixed?
Shuttle calls
hyper_reverse_proxy::ReverseProxy::call
here which internally handles adding theX-Forwarded-For
if it doesn't exist here. The first argument to thecall
method is the client's IP to use for this.I don't think it sets
X-Forwarded-Proto
so maybe that is why this issue is still open?
Unfortunately, we did not find a solution on the current platform. The proxy is behind an AWS NLB, which can forward the client IP by preserving it (a connection from the NLB will have the IP of the original client), it can't set headers. Then, the traffic hits a Docker swarm load balancer before it hits the proxy, which changes the IP (which was the client IP up to this point) of the connection made to the proxy to the IP of the load balancer.
However, we are working on a new version of the platform, that is due to be opened in the next few weeks. On the new version, we are no longer using Docker swarm, and the new proxy is built with Pingora. There, the X-Forwarded-For
header is already supported, and we intend to add more proxy headers as well. If you want to test the new platform before it is more widely announced, reach out to us on Discord, and we can get you set up with access!
X-Forwarded-For is supported on shuttle.dev