1 :mod:`websocket` -- Websocket Server
2 =====================================
4 This module provides a simple way to create a `websocket
5 <http://dev.w3.org/html5/websockets/>`_ server. It works with a few
6 tweaks in the :mod:`~eventlet.wsgi` module that allow websockets to
7 coexist with other WSGI applications.
9 To create a websocket server, simply decorate a handler method with
10 :class:`WebSocketWSGI` and use it as a wsgi application::
12 from eventlet import wsgi, websocket
15 @websocket.WebSocketWSGI
17 ws.send("hello world")
19 wsgi.server(eventlet.listen(('', 8090)), hello_world)
23 Please see graceful termination warning in :func:`~eventlet.wsgi.server`
27 You can find a slightly more elaborate version of this code in the file
28 ``examples/websocket.py``.
30 As of version 0.9.13, eventlet.websocket supports SSL websockets; all that's necessary is to use an :ref:`SSL wsgi server <wsgi_ssl>`.
32 .. note :: The web socket spec is still under development, and it will be necessary to change the way that this module works in response to spec changes.
35 .. automodule:: eventlet.websocket