Re: HTTP_X_FORWARDED_FOR
| From: | Richard Lynch | Date: | Thu, 13 Sep 2001 04:05:51 +0000 |
| Subject: | Re: HTTP_X_FORWARDED_FOR | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67132@lists.php.net to get a copy of this message | ||
I'm not sure there is any kind of standard for HTTP_X_FORWARDED_FOR...
I think all the X headers are "user-defined"
I believe you're at the mercy of whomever defined the masquereding server.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Tobias Strauß <tobiasstrauss@ngi.de>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Sunday, September 09, 2001 2:20 AM
Subject: HTTP_X_FORWARDED_FOR
> On php.net I found this:
>
> When you use REMOTE_ADDR for getting the IP of the current user, sometimes
> you get the IP of the ISP Cache server.
> When this happens, the HTTP_X_FORWARDED_FOR is also set, it contains the
IP
> of the user.
> [...]
> Note that the X-Forwarded for header might contain multiple addresses,
comma
> separated, if the request was forwarded through multiple proxies.
> [...]
>
> My question is:
> If the X-Forwarded for header contains multiple addresses, comma
separated,
> where do I find the one of the user? (I which order does it contain the
> adresses?)
> Do I get the right order (from the last proxies (at the beginning) to the
> user itself (at the end)) when I do this:
> $ip_route = $HTTP_SERVER_VARS["REMOTE_ADDR"] . "," .
> $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
> So that I finally have a chronological sorted list (i know: a string that
> contains the comma seperated ip-addresses of the users way to me (if they
> were forwarded by the proxie))? Am I right?
>
> Thanks for any coments about this.
>
>