I have a Pythonic HTTP server that is supposed to determine client's IP. How do I do that in Python? Is there any way to get the request headers and extract it from there?
PS: I'm using WebPy.
Use web.ctx:
class example:
def GET(self):
print web.ctx.ip
More info here
web.env.get('REMOTE_ADDR')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With