my mp2 needs to get the ip of the remote address

on some installations, mp2 is on port 80

on other installations, mp2 is on 80xx and the ip is in X-Forwarded-For

i'd like to ensure that i pull the ip off the right place, under the right conditions. all of my get_ip() calls happen in a shared library though, so I need to figure out a way to handle this under those constraints, and not deal with spoofs.

first i found this module
        Apache::ForwardedFor
http://search.cpan.org/~jlawrenc/Apache-ForwardedFor-0.5/lib/Apache/ ForwardedFor.pm

but its
        Apache1
        not porting nicely
        designed oddly- doesn't seem to forw

short of rewriting it , which i might have to do, maybe someone has an apach2 compatible solution already?

i'm thinking that the easiest way to do this would be:

httpd.conf-
run a preliminary handler that strips all x-forwarded-for headers unless:
                we're running on port 80
we're running on port 80 but there's some internal lan header marking that says its coming off a load balancer i control

although i could just do a conditional rewrite of headers in a new forwarded module

Reply via email to