Re: best way to get user's IP address in pylons?

2008-07-09 Thread Shannon -jj Behrens
On Mon, Jul 7, 2008 at 6:18 PM, Shannon -jj Behrens [EMAIL PROTECTED] wrote: Ugh, looking at request.environ, Varnish is giving me HTTP_X_FORWARDED_FOR. Looking at my old Aquarium code, it respected X_FORWARDED_HOST. Looking at Paste's proxy middleware, I see that it looks for

Re: best way to get user's IP address in pylons?

2008-07-09 Thread Ben Bangert
On Jul 9, 2008, at 11:56 AM, Shannon -jj Behrens wrote: The trick is configuring Nginx with: proxy_set_headerHost $host; proxy_set_headerX-Real-IP $remote_addr; proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for; Once you do this, you don't even need to use

Re: best way to get user's IP address in pylons?

2008-07-07 Thread Jonathan Vanasco
On Jul 7, 1:46 pm, Ian Bicking [EMAIL PROTECTED] wrote: Christopher Weimann wrote: REMOTE_ADDR is typically set by your webserver and can be trusted.   X_FORWARDED_FOR is an HTTP header typically set by proxy servers or even the client and I would have to say it can NOT be trusted so

Re: best way to get user's IP address in pylons?

2008-07-03 Thread Wichert Akkerman
Previously Chris AtLee wrote: On Thu, Jul 3, 2008 at 1:04 PM, kevin [EMAIL PROTECTED] wrote: hello, hope all is well. i'm wondering what the best way to get a user's IP address is? because the reCaptcha verification wants the remote IP. I know I can get request.host and

Re: best way to get user's IP address in pylons?

2008-07-03 Thread Jonathan Vanasco
On Jul 3, 4:42 pm, Wichert Akkerman [EMAIL PROTECTED] wrote: Possibly better:   request.environ.get(X_FORWARDED_FOR, request.environ[REMOTE_ADDR]) maybe someone can make a middleware or pylons patch + config setting that migrates X_FORWARDED_FOR to REMOTE_ADDR this is the one i maintain for

Re: best way to get user's IP address in pylons?

2008-07-03 Thread Ian Bicking
Jonathan Vanasco wrote: On Jul 3, 4:42 pm, Wichert Akkerman [EMAIL PROTECTED] wrote: Possibly better: request.environ.get(X_FORWARDED_FOR, request.environ[REMOTE_ADDR]) maybe someone can make a middleware or pylons patch + config setting that migrates X_FORWARDED_FOR to REMOTE_ADDR

Re: best way to get user's IP address in pylons?

2008-07-03 Thread Wichert Akkerman
Previously Jonathan Vanasco wrote: On Jul 3, 4:42 pm, Wichert Akkerman [EMAIL PROTECTED] wrote: Possibly better:   request.environ.get(X_FORWARDED_FOR, request.environ[REMOTE_ADDR]) maybe someone can make a middleware or pylons patch + config setting that migrates X_FORWARDED_FOR to

Re: best way to get user's IP address in pylons?

2008-07-03 Thread Ian Bicking
Shannon -jj Behrens wrote: On Thu, Jul 3, 2008 at 2:05 PM, Ian Bicking [EMAIL PROTECTED] wrote: Jonathan Vanasco wrote: On Jul 3, 4:42 pm, Wichert Akkerman [EMAIL PROTECTED] wrote: Possibly better: request.environ.get(X_FORWARDED_FOR, request.environ[REMOTE_ADDR]) maybe someone can make