[Twisted-Python] anyway to know client address in XMLRPC?
hello, I need to know the client address connected to my Twisted XMLRPC server, is there any way? the fellow code couldn't work in my machine. class Examle(xmlrpc.XMLRPC): """An example object to be published.""" def _getPeerAddress(self): return self.request.getClientIP() def render(self, request): self.request = request xmlrpc.XMLRPC.render(self, request) the result is said: "C:\Python24\lib\site-packages\twisted\web\server.py:272: UserWarning: Warning! r equest.finish called twice. http.Request.finish(self)" then how can I get client address in twisted?
wang wei wrote:
hello, I need to know the client address connected to my Twisted XMLRPC server, is there any way? the fellow code couldn't work in my machine. class Examle(xmlrpc.XMLRPC): """An example object to be published."""
def _getPeerAddress(self): return self.request.getClientIP()
def render(self, request): self.request = request xmlrpc.XMLRPC.render(self, request)
the result is said: "C:\Python24\lib\site-packages\twisted\web\server.py:272: UserWarning: Warning! r equest.finish called twice. http.Request.finish(self)" then how can I get client address in twisted?
Try: def render(self, request): self.request = request return xmlrpc.XMLRPC.render(self, request) - Remi -
participants (2)
-
Remi Cool
-
wang wei