@@ -19,9 +19,10 @@ features:
1919 Socket.IO specification.
2020- Compatible with Python 2.7 and Python 3.3+.
2121- Supports large number of clients even on modest hardware when used with an
22- asynchronous server based on `asyncio <https://docs.python.org/3/library/asyncio.html >`_,
23- `eventlet <http://eventlet.net/ >`_ or `gevent <http://gevent.org/ >`_. For
24- development and testing, any WSGI complaint multi-threaded server can also be
22+ asynchronous server based on `asyncio <https://docs.python.org/3/library/asyncio.html >`_
23+ (`sanic <http://sanic.readthedocs.io/ >`_ and `aiohttp <http://aiohttp.readthedocs.io/ >`_),
24+ `eventlet <http://eventlet.net/ >`_ or `gevent <http://gevent.org >`_. For
25+ development and testing, any WSGI compliant multi-threaded server can also be
2526 used.
2627- Includes a WSGI middleware that integrates Socket.IO traffic with standard
2728 WSGI applications.
@@ -458,14 +459,40 @@ Deployment
458459The following sections describe a variety of deployment strategies for
459460Socket.IO servers.
460461
461- Aiohttp
462+ Sanic
463+ ~~~~~
464+
465+ `Sanic <http://sanic.readthedocs.io/ >`_ is a very efficient asynchronous web
466+ server for Python 3.5 and newer.
467+
468+ Instances of class ``socketio.AsyncServer `` will automatically use Sanic for
469+ asynchronous operations if the framework is installed. To request its use
470+ explicitly, the ``async_mode `` option can be given in the constructor::
471+
472+ sio = socketio.AsyncServer(async_mode='sanic')
473+
474+ A server configured for aiohttp must be attached to an existing application::
475+
476+ app = web.Application()
477+ sio.attach(app)
478+
479+ The Sanic application can define regular routes that will coexist with the
480+ Socket.IO server. A typical pattern is to add routes that serve a client
481+ application and any associated static files.
482+
483+ The Sanic application is then executed in the usual manner::
484+
485+ if __name__ == '__main__':
486+ app.run()
487+
488+ aiohttp
462489~~~~~~~
463490
464491`Aiohttp <http://aiohttp.readthedocs.io/ >`_ is a framework with support for HTTP
465492and WebSocket, based on asyncio. Support for this framework is limited to Python
4664933.5 and newer.
467494
468- Instances of class ``engineio .AsyncServer `` will automatically use aiohttp
495+ Instances of class ``socketio .AsyncServer `` will automatically use aiohttp
469496for asynchronous operations if the library is installed. To request its use
470497explicitly, the ``async_mode `` option can be given in the constructor::
471498
0 commit comments