[Twisted-Python] XMLRPC getting calling host
wari at home.wari.org
Wed May 28 00:46:18 EDT 2003
Heiko Wundram wrote:
>I've come to the point where I need to query the IP an XMLRPC request
>came from. In UDP, you get it served when the call to datagramReceived
>comes through, but I've not seen any attribute of the XMLRPC class, or
>of the underlying Resource class which states anything about how to get
>this attribute. Is it possible? And if, how?
Just a stab in the dark here, but I believe it's possible to override
the render method to get this information via the request parameter.
from twisted.web import xmlrpc
def render(self, request):
self._ip = request.something # Get IP information here
def xmlrpc_method(self, *args):
# You can now use self._ip for this instance of MyXmlRpcHandler
Sorry for my lack of knowledge in the request object object, but every
known html info about the request is available there.
More information about the Twisted-Python