Because cross-domain xmlrpc requests are not possible in JavaScript I need to create a Python app which exposes both some HTML through HTTP and an XML-RPC service on the same domain.
Creating an HTTP request handler and SimpleXMLRPCServer in python is quite easy, but they both have to listen on a different port, which means a different domain.
Is there a way to create something that will listen on a single port on the localhost and expose both the HTTPRequestHandler and XMLRPCRequest handler?
Right now I have two different services:
httpServer = HTTPServer(('localhost',8001), HttpHandler);
xmlRpcServer = SimpleXMLRPCServer(('localhost',8000),requestHandler=RequestHandler)
Update
- I cannot install Apache on the device
- The hosted page will be a single html page
- The only client will be the device on witch the python service runs itself