From a0c29a94b1d53306550e8c5ffc4fcb71f6fb20b7 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 19 May 2019 14:49:11 +0100 Subject: [PATCH] minor doc improvements (fixes #960) --- docs/index.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 7fc0d79b..b3c14990 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -76,14 +76,15 @@ application:: if __name__ == '__main__': socketio.run(app) -The ``init_app()`` style of initialization is also supported. Note the way the -web server is started. The ``socketio.run()`` function encapsulates the start -up of the web server and replaces the ``app.run()`` standard Flask -development server start up. When the application is in debug mode the -Werkzeug development server is still used and configured properly inside -``socketio.run()``. In production mode the eventlet web server is used if -available, else the gevent web server is used. If eventlet and gevent are not -installed, the Werkzeug development web server is used. +The ``init_app()`` style of initialization is also supported. To start the +web server simply execute your script. Note the way the web server is started. +The ``socketio.run()`` function encapsulates the start up of the web server and +replaces the ``app.run()`` standard Flask development server start up. When the +application is in debug mode the Werkzeug development server is still used and +configured properly inside ``socketio.run()``. In production mode the eventlet +web server is used if available, else the gevent web server is used. If +eventlet and gevent are not installed, the Werkzeug development web server is +used. The ``flask run`` command introduced in Flask 0.11 can be used to start a Flask-SocketIO development server based on Werkzeug, but this method of starting @@ -91,7 +92,7 @@ the Flask-SocketIO server is not recommended due to lack of WebSocket support. Previous versions of this package included a customized version of the ``flask run`` command that allowed the use of WebSocket on eventlet and gevent production servers, but this functionality has been discontinued in favor of the -``socketio.run(app)`` startup method shown above. +``socketio.run(app)`` startup method shown above which is more robust. The application must serve a page to the client that loads the Socket.IO library and establishes a connection::