Handling IP addresses with SimpleXMLRPCServer.
Jose Carlos Balderas Alberico
josecarlos.balderas at gmail.com
Thu Apr 6 03:39:46 EDT 2006
Hello. I' m trying to use the client's IP address in a method defined inside
the SimpleXMLRPCServer. Up till now I'm able to verify that the client's IP
is an authorised one (I do this before calling the _dispatch method). I can
redefine the _dispatch method extending the SimpleXMLRPCHandler class, and
do something like
if (self.client_address[0] not in [list of IPs])
raise self.UnknownIP, "Unknown IP address"
else
*inserts SimpleXMLRPCHandler's _dispatch code in here*
This works just fine, but I need to do something else. I need to have the IP
address within the called method to know who's the client calling the
method, and act in cosequence. There are 4 possible clients who will be
requesting data from the server, and I need to check woh's actually
requesting them via IP.
Is there any way to handle the client's IP inside a method in the server?
Thank you very much in advance for your help.
Jose Carlos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060406/da3b58a8/attachment.html>
More information about the Python-list
mailing list