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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -