Home > Mobile >  What do commas mean in http requests
What do commas mean in http requests

Time:08-03

So on my personal website (hosted on heroku and uses express.js), I was looking at the logs of all the requests and some of them confused me. This is the format I got: 2022-08-03T00:10:46.101902 00:00 heroku[router]: at=info method=GET path="/" host=www.website.com request_id=f9757d53-7cf8-4c3d-9def-d206b2762b98 fwd="2607:fea8:bb22:4500:7177:5233:f8aa:478a,74.125.210.57" dyno=web.1 connect=0ms service=2ms status=200 bytes=20999 protocol=http. But the part that confuses me is this fwd="2607:fea8:bb22:4500:7177:5233:f8aa:478a,74.125.210.57". Usually its in ipv4 format or ipv6 i have never seen this format before please help. Thank you in advance!

CodePudding user response:

fwd

Is a custom HTTP header, and the contents are both an IPv6 and IPv4 address separated by a comma.

IPv6 formats can vary; this is a full length address

2607:fea8:bb22:4500:7177:5233:f8aa:478a

And then of course, this is an IPv4 address

74.125.210.57

CodePudding user response:

If there are multiple proxies in a chain, X-Forwarded-For should contain all IPs of the proxies, so the path can be preserved.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For

  • Related