Skip to content

Commit

Permalink
minor doc improvements (fixes #960)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 19, 2019
1 parent 611fa68 commit a0c29a9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/index.rst
Expand Up @@ -76,22 +76,23 @@ 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
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::
Expand Down

0 comments on commit a0c29a9

Please sign in to comment.