Bases: builtins.object
Wraps a websocket handler function in a WSGI application.
Use it like this:
@websocket.WebSocketWSGI
def my_handler(ws):
from_browser = ws.wait()
ws.send("from server")
The single argument to the function will be an instance of WebSocket. To close the socket, simply return from the function. Note that the server will log the websocket request at the time of closure.
Bases: builtins.object
A websocket object that handles the details of serialization/deserialization to the socket.
The primary way to interact with a WebSocket object is to call send() and wait() in order to pass messages back and forth with the browser. Also available are the following properties:
Parameters: |
|
---|
Forcibly close the websocket; generally it is preferable to return from the handler method.