Popular recipes tagged "webpy"http://code.activestate.com/recipes/tags/webpy/popular/2011-07-15T21:19:17-07:00ActiveState Code RecipesGet user's IP address even when they're behind a proxy (Python) 2011-07-15T21:19:17-07:00Ben Hoythttp://code.activestate.com/recipes/users/4170919/http://code.activestate.com/recipes/577795-get-users-ip-address-even-when-theyre-behind-a-pro/ <p style="color: grey"> Python recipe 577795 by <a href="/recipes/users/4170919/">Ben Hoyt</a> (<a href="/recipes/tags/address/">address</a>, <a href="/recipes/tags/cgi/">cgi</a>, <a href="/recipes/tags/ip/">ip</a>, <a href="/recipes/tags/web/">web</a>, <a href="/recipes/tags/webpy/">webpy</a>). </p> <p>Function to get the user's IP address in a web app or CGI script, even when they're behind a web proxy.</p> <p>We use web.py as our web framework, but change web.ctx.env and web.ctx.get('ip') to whatever the equivalents are for the CGI environment variables and REMOTE_ADDR are in your framework.</p>