On Today at 10:14am, RK=>Randy Kobes <[EMAIL PROTECTED]> wrote: RK> RK> There's a discussion on perlmonks about this: RK> http://www.perlmonks.org/?node_id=390160 RK> with reference to RK> http://www.openinfo.co.uk/apache/ RK> With due care to determining trusted proxies, it shows that RK> in the header RK> X-Forwarded-For: client1, proxy1, proxy2 RK> the client's IP address is the left-most entry in this list. RK>
Hi Randy, Your analysis is correct. A typical X-Forwarded-For header would look exactly as you said. However, my case is a little different. In my case (reverse proxy), I will have a typical request come in on the back-end server with: $r->connection->remote_ip = 127.0.0.1 and a header: X-Forwarded-For: client1, proxy1, proxy2, ip_as_seen_by_front_end I am only really interested in ip_as_seen_by_front_end and not the client1 address (don't care about that - it could be spoofed for all I know). That's why I chose to use the "last address" in the chain so that I am able to set $r->connection->remote_ip(ip_as_seen_by_front_end) If I was indeed interested in client1, then I would pick the following: $r->connection->remote_ip(client1) I hope that explains my situation and reasoning. Regards, -- Haroon Rafique <[EMAIL PROTECTED]> -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html