From: Daniel Berger Date: 2002-10-24T01:15:42+09:00 Subject: Re: XMLRPC and IP authentication Michael Neumann wrote: > > > I've added a ip_auth_handler method in class Server, which is called > from method serve (in httpserver.rb) before request_handler is called. > This method should return true if the client is allowed to connect, > otherwise false. > This way, you can simply override Server#ip_auth_handler to perform > IP-based restrictions. > > What's the right status code when IP auth disallows access? > 405 - Method not allowed? > > Regards, > > Michael Sounds interesting, but how does it work? All I really want to do is something like this: valid_ip = ["1.2.3.4","22.33.44.55"] server.set_service_hook{ |obj,*args| raise SomeException unless valid_ip.include?(server.peer_addr) obj.call(*args) } Regards, Dan