Files
deb-python-autobahn/examples/twisted/wamp/app/hello
meejah 8db76f8b2a replace localhost with 127.0.0.1 in all examples
This ensures we use IPv4 addresses; at least with Trollius
on Python 2.7 "localhost" can result in IPv6 addresses but
the examples are all currently written for IPv4
2015-08-13 13:58:24 -06:00
..

Hello WAMP

This example demonstrates the use of wamp.Application objects, an alternative WAMP API to ApplicationSession.

Application objects provide a Flask-esque API to WAMP. You create an application object and then can e.g. register procedures using decorators:

app = Application()

@app.register('com.example.add2')
def add2(a, b):
   return a + b

Running the Example

Start the app component for development in a standalone router embedding the component:

python hello.py

Open hello.html in your browser.