File: README.md

package info (click to toggle)
python-autobahn 17.10.1%2Bdfsg1-3%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,292 kB
  • sloc: python: 22,596; makefile: 499; sh: 3
file content (22 lines) | stat: -rw-r--r-- 696 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# WebSocket "Slow-Square" (Asyncio-based)

This example shows a WebSocket server that will receive a JSON encode float over WebSocket, slowly compute the square, and send back the result.

This example is intended to demonstrate how to use coroutines inside WebSocket handlers.

> This example uses the Asyncio integration of **Autobahn**|Python. You can find the corresponding example using the Twisted integration [here](https://github.com/crossbario/autobahn-python/tree/master/examples/twisted/websocket/slowsquare).
> 

## Running

Run the server (Python 3)

    python server.py

or (Python 2)

    python server_py2.py

To run the Python client (both Python 3 and 2)

    python client.py