[Twisted-Python] How to get the IP address of a client using XML-RPC

May 2004
7:25 p.m.
New subject: [Twisted-Python] How to get the IP address of a client using XML-RPC
Daniel Newton wrote:
I have a simple XML-PRC server similar to the example below:
from twisted.web import xmlrpc, server
class Example(xmlrpc.XMLRPC): """An example object to be published."""
def xmlrpc_add(self, a, b): """Return sum of arguments.""" return a + b
def xmlrpc_whatIsMyAddress(self): return self.transport.getPeer().host
if __name__ == '__main__': from twisted.internet import reactor r = Example() reactor.listenTCP(7080, server.Site(r)) reactor.run()
I want to be able to get the address of the client that calls the xmlrpc method can anyone help me with this?
thanks in advance
Daniel Newton
Jp
7584
Age (days ago)
7584
Last active (days ago)
1 comments
2 participants
participants (2)
-
Daniel Newton
-
Jp Calderone