Let's say I make an https GET request to a webserver with curl without specifying any headers.

On the webserver, I see the incoming request has a X-Forwarded-For (XFF) header set. Given that I did not set that header, who set it?

My guess is that my ISP intercepts my request and adds that header to my request. Then, additional links (switches, routers, etc.) on the way to the webserver add their own IP to the XFF header.

Is this correct? Assuming yes, what happens if I set the XFF header in my request? Will the ISP override that header or will it append its IP to that header?

  • en.m.wikipedia.org/wiki/X-Forwarded-For You can really only guess at who is setting this header, as your request could go through load balancer or proxies at any point between you and a destination.
    – tilleyc
    Jun 10 '21 at 1:15
  • I see. How do server frameworks determine the RemoteAddr of a request, then? I believe such a field is offered at least on PHP and Go servers. Do those frameworks also look at the XFF header or not?
    – bkr879
    Jun 10 '21 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.