I’m trying to set a page that displays the visitor’s IP. All the methods I have tried show an IP different from the IP my computer has. I’ve tried:
-
Looking up http://www.whatismyip.com/automation/n09230945.asp
-
Using socket.getaddrinfo(socket.gethostname(), None)[0][4][0]
How can I find the real IP of the visitor?
I found a simple solution:
This will return the IP address of the computer connecting to the server.