How to get IP address of client from CGI module?

J

John Nagle

The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas?

John Nagle
 
C

Cameron Laird

The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas?

John Nagle

os.environ['REMOTE_ADDR']?
 
G

Graham Dumpleton

The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas?

John Nagle

Read the CGI RFC.

http://www.ietf.org/rfc/rfc3875

Specifically section 4.1.8.

This value should be supplied by way of variable in os.environ as are
all the CGI variables.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top