Determine local socket IP address per request

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Determine local socket IP address per request


I'm starting a cherrypy server bound to on a machine that has multiple NICs.

Is there a way to determine the IP address of the NIC that was resposible for handling the request?

e.g., on a machine with two NICs with addresses (,, requestes coming from would show as the IP of the NIC that processed the request.

I know that with low level sockets I can call getsockname() on the accept()ed socket to retrieve the address of the NIC.

- Adam

You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit