WAMP-Klein Application
This example demonstrates combining a Klein Web application with a Autobahn WAMP application.
Klein essentially is Flask for Twisted Web.
What we do
- The app will run a Klein-based Web server.
- Our Web code will receive HTML form data via a plain old HTTP/POST.
- Upon receiving the HTTP/POST, the request handler will perform an asynchronous call to a WAMP procedure before returning
- The WAMP procedure called is running as a WAMP component connected to a WAMP router
- The Web app is also connected to the same router, so it can call the procedure
Running the Example
Install dependencies:
pip install autobahn[twisted] klein
Start our WAMP application component (together with a development WAMP router):
python server_wamp.py
You can test the WAMP application component from your browser by opening test_wamp.html.
Now, start our Klein-based Web server (which will connect to above WAMP router):
python server_web.py
Open test_web.html in your browser.