Re: Ip-to-country
| From: | Jim Winstead | Date: | Mon, 05 May 2003 23:19:20 +0000 |
| Subject: | Re: Ip-to-country | ||
| References: | 1 2 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-17346@lists.php.net to get a copy of this message | ||
On Mon, May 05, 2003 at 04:07:34PM -0700, Rasmus Lerdorf wrote:
> Well, no, in my case it is a direct connection from my office. The
> headers I showed you are the final headers seen by PHP on the server.
ah, okay. in any case, this problem does occur in the wild, so the
ip-to-country.inc code does need to get fixed to handle it. (and a good
way of debugging it is to have the code spit out which ip address it
tried to use when it fails.)
of course, then this code becomes dependent on whether or not the local
php mirror is running behind squid. if it is, it needs to look at
X-Forwarded-For before REMOTE_ADDR (and make sure to get only the most
recent forwarded-for). if it is not running behind a local squid
accelerator, it needs to ignore X-Forwarded-For, or it will be trying to
look up internal addresses for those behind a proxy.
jim