How to get client IP address using python bottle framework -
i need client ip address using python. have tried below code not working in server:
from socket import gethostname, gethostbyname ip = gethostbyname(gethostname()) print ip
on server, '127.0.0.1' every time. there way find ip address of client?
server might behind proxy. use proxy , forward support:
request.environ.get('http_x_forwarded_for') or request.environ.get('remote_addr')
Comments
Post a Comment