Re: Question about client ip

From: Ulric Eriksson (
Date: Sun Feb 01 2004 - 02:15:27 CET

On Sun, 1 Feb 2004, Michael Kagerbauer wrote:

> In my PHP-Script, I'm checking if HTTP_X_FORWARDED_FOR or HTTP_VIA is set -
> if this is true, the user comes from a proxy server. We are not paying our
> users if a client uses a proxy because of security reasons. So the best
> thing would be if pen uses a new variable (not X-Forwarded for).
> I looked at pen.c and found the function "rewrite_request" where pen is
> parsing the header lines - I think this is the right place to write a new
> variable to the header. Unfortunatly I haven't enough knowledge about
> environment variables to change that myself - it would be very nice if
> someone could send me a patched file and an example how this new variable
> can be read out in PHP.

Do this:

mv pen.c pen.c.old
sed -e 's,X-Forwarded-For,X-Ulric-Fibbar,g' < pen.c.old > pen.c
make install

And restart pen.

Now you can look for the X-Ulric-Fibbar header instead. In php it will
become the environment variable HTTP_X_ULRIC_FIBBAR.


This archive was generated by hypermail 2.1.2 : Sun Feb 01 2004 - 02:16:01 CET