What Is X-Forwarded-For and Does It Give Away Your Real IP?
You set up a proxy so websites see the proxy's address instead of yours. Then someone mentions a header called X-Forwarded-For, and you wonder if your real IP has been riding along the whole time. Fair question. Short answer: yes, it can happen. Longer answer: only with certain proxies, and you can check yours in about two minutes.

What X-Forwarded-For actually is
Every time your browser asks a website for a page, it sends a bundle of small notes called headers. One of them can be X-Forwarded-For, usually shortened to XFF. When a proxy forwards your request, it can write your IP address into that header, so the site at the end knows who asked. The header holds a list, like this:
X-Forwarded-For: 203.0.113.195, 198.51.100.42
Read it left to right. The first address is the original client, you. Each address after it is a proxy the request passed through. Think of a parcel passed from courier to courier, each one writing their name on the label. By the time it arrives, the label tells the whole story of the trip. XFF works the same way, except the first name on the label can be your real IP.
The header was never made an official standard. It started with the Squid caching proxy years ago, and it stuck because every load balancer and CDN uses it. The standard replacement is the Forwarded header (RFC 7239), but XFF is still the one you will meet. MDN's page on the X-Forwarded-For header covers the format and the trust rules in detail.
Which proxies hand over your IP (and which don't)
Not every proxy adds this header. It comes down to the proxy's anonymity level, the same three levels from our elite vs anonymous vs transparent guide:
- Transparent: adds your real IP to X-Forwarded-For and often announces itself with a Via header too. The site sees you, and knows you used a proxy. Worst of both worlds.
- Anonymous: hides your IP from the header, but still says a proxy is in use, usually through that same Via header.
- Elite: adds nothing at all. The site sees only the proxy's IP, and nothing in the headers says a proxy was involved.
My honest opinion: if privacy is why you use a proxy, a transparent proxy is worse than useless. It gives you the slow speed of a proxy and the exposure of a direct connection. Pick elite, or don't bother.
When I tested this, I pulled the first 500 HTTP entries from our own live list. Only 5 carried any anonymity label at all: 4 elite, 1 anonymous. The other 495 said nothing about what they write into your headers. A list can tell you an IP is alive and fast, but not what the proxy does with your headers. Check it yourself, as the next section shows.
Prefer watching? This short nginx walkthrough shows the exact lines where X-Forwarded-For gets set.

Test your own proxy in 2 minutes
No special software needed. Two minutes and a browser:
- Find your real IP first. Open our What Is My IP tool with the proxy switched off, and write the number down.
- Switch your browser to the proxy. Paste the proxy IP and port into your browser or system proxy settings. Our Android, iPhone and Chrome setup guide walks through it if you need the steps.
- Open the HTTP Headers tool. Our HTTP Headers tool shows the headers your browser just sent, exactly as our server received them, the same tool from our guide to what HTTP headers reveal about you.
- Look for the X-Forwarded-For line. If your real IP from step 1 appears in that list, your proxy is handing it over. If the header is missing, or lists only the proxy's own address, your IP stayed hidden.
- Double-check with the Proxy Checker. Run the same proxy through our Proxy Checker. It reports the IP the site sees and flags leaks, a second opinion before you trust the result.
Say your real IP is 203.0.113.195 and you are testing a proxy at 198.51.100.42. You open the headers tool and see X-Forwarded-For: 203.0.113.195. That is a fail: the proxy just told the site who you are. Switch to another proxy from the proxy list and run the check again. When the header is gone, or it reads X-Forwarded-For: 198.51.100.42 only, you are good.
If your proxy leaks, here is the fix
First, drop that proxy. Grab another from the proxy list, ideally one labelled elite, and re-check. Free proxies come and go, so a proxy that leaks today is not worth troubleshooting.
Second, try SOCKS5 instead of HTTP. It works at a lower level and never adds HTTP headers, so XFF simply cannot happen. Our HTTP vs SOCKS5 comparison explains when to pick each one.
Third, keep perspective. If every free proxy you try leaks, the job probably needs a VPN, not another proxy. A proxy hides your IP from one app, a VPN from everything. We compared the two honestly in our free VPN vs free proxy guide.

The other side: why websites can't trust this header either
XFF cuts both ways. A website that reads it gets your real IP, but it also gets a header anyone can fake. I can send a request with X-Forwarded-For: 1.2.3.4 typed in by hand, and a careless server will believe I am 1.2.3.4. That is why good servers only trust entries added by their own proxies, and count inward from the right side of the list. MDN says the same: no part of the list can be trusted unless every hop that added it is under your control.
This is also why a website blocking you "because of XFF" is usually doing it wrong. Rate limits and bans should rest on the connection's real source IP, not a header the visitor controls. If a site ever calls your IP suspicious while you are on a proxy, check the header first, and our 5-minute proxy leak test covers the other ways your real IP can slip out.
Quick answers
Does every proxy add X-Forwarded-For? No. Elite proxies add nothing, anonymous proxies hide your IP, and only transparent proxies hand it over. SOCKS5 proxies never add it, because they don't touch HTTP headers.
Does HTTPS protect me from it? Partly. With HTTPS, a forward proxy tunnels your encrypted traffic and cannot stamp headers onto it. XFF mostly shows up with plain HTTP, or when a load balancer in front of the site adds it.
Can a site block me because of this header? Only if the site is badly set up. Sensible sites never ban based on a header the visitor can type by hand.
Check your proxy now
That's the whole story. X-Forwarded-For is a small header with a big job, and now you know how to read it. Two minutes of testing is the difference between thinking you are hidden and knowing it.
Comments
Loading comments…
Leave a comment