views:

75

answers:

2

I have a server that has to respond to HTTP and XML-RPC requests. Right now I have an instance of SimpleXMLRPCServer, and an instance of BaseHTTPServer.HTTPServer with a custom request handler, running on different ports. I'd like to run both services on a single port.

I think it should be possible to modify the CGIXMLRPCRequestHandler class to also serve custom HTTP requests on some paths, or alternately, to use multiple request handlers based on what path is requested. I'm not really sure what the cleanest way to do this would be, though.

A: 

Is there a reason not to run a real webserver out front with url rewrites to the two ports you are usign now? It's going to make life much easier in the long run

gnibbler
I'm writing a standalone desktop application, so requiring a standalone web server would definitely be too much work for the user to configure.
p-static
A: 

Use SimpleXMLRPCDispatcher class directly from your own request handler.

Denis Otkidach
Thanks, this seems like it'll work! For future reference, the _marshaled_dispatch method was the really useful one
p-static