Pyro5.utils.httpgateway — HTTP to Pyro gateway

HTTP gateway: connects the web browser’s world of javascript+http and Pyro. Creates a stateless HTTP server that essentially is a proxy for the Pyro objects behind it. It exposes the Pyro objects through a HTTP interface and uses the JSON serializer, so that you can immediately process the response data in the browser.

You can start this module as a script from the command line, to easily get a http gateway server running:

python -m Pyro5.utils.httpgateway or simply: pyro5-httpgateway

It is also possible to import the ‘pyro_app’ function and stick that into a WSGI server of your choice, to have more control.

The javascript code in the web page of the gateway server works with the same-origin browser policy because it is served by the gateway itself. If you want to access it from scripts in different sites, you have to work around this or embed the gateway app in your site. Non-browser clients that access the http api have no problems. See the http example for two of such clients (node.js and python).

Pyro5.utils.httpgateway.pyro_app(environ, start_response)

The WSGI app function that is used to process the requests. You can stick this into a wsgi server of your choice, or use the main() method to use the default wsgiref server.