WebSocket Echo (Asyncio-based)

This example shows a WebSocket echo server that will echo back any WebSocket message it receives to the client that sent the message.

It also includes a WebSocket client that will send a WebSocket message every second to the server it connected to. The Python client is available in two variants.

Lastly, a HTML5 client is also included.

This example uses the Asyncio integration of Autobahn|Python. You can find the corresponding example using the Twisted integration here.


Run the server:


and open


in your browser.

To run the Python client

python ws://

or (Python 3)

python ws://

or (Python 2)

python ws://