Files
deb-python-autobahn/examples/twisted/websocket/ping
Tobias Oberstein 5da80641ac fixes for Python 3
2013-12-29 22:25:22 +01:00
..
2013-12-23 00:13:34 +01:00
2013-12-29 22:25:22 +01:00
2013-12-23 00:13:34 +01:00
2013-12-23 00:13:34 +01:00
2013-12-29 22:25:22 +01:00

WebSocket Ping Server and Client

This example runs a WebSocket server that pings any connected WebSocket client every second (via WebSocket Ping frames).

Included is a HTML and a Python client.

This example uses secure WebSocket (TLS).

Running

Run the server by doing

python server.py

and open

https://localhost:8080/

in your browser.

To run the Python client, do

python client.py wss://localhost:9000

For both server and client you can add debug to the command line to activate wire logging of all sent and received WebSocket messages.