From 87e2594b6065f0611085940573a971e9de0e8bf8 Mon Sep 17 00:00:00 2001 From: Sebastian Oliva Date: Thu, 3 Sep 2015 19:04:07 -0600 Subject: [PATCH] Update README.rst --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index a51153c..c67ee84 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,14 @@ Elegant WebSockets for your Flask apps. @app.route('/') def hello(): return 'Hello World!' + + + if __name__ == "__main__": + from gevent import pywsgi + from geventwebsocket.handler import WebSocketHandler + server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler) + server.serve_forever() + Serving WebSockets in Python was really difficult. Now it's not. @@ -44,6 +52,7 @@ A custom Gunicorn worker is included to make deployment as friendly as possible: Production services are provided by `gevent `_ and `gevent-websocket `_. +The given example can run standalone as main. Anything that inserts ``wsgi.websocket`` into the WSGI environ is supported, but gevent-websocket is recommended.