@@ -22,8 +22,8 @@ Elegant WebSockets for your Flask apps.
22
22
@app.route (' /' )
23
23
def hello ():
24
24
return ' Hello World!'
25
-
26
-
25
+
26
+
27
27
if __name__ == " __main__" :
28
28
from gevent import pywsgi
29
29
from geventwebsocket.handler import WebSocketHandler
@@ -40,8 +40,8 @@ Installation
40
40
To install Flask-Sockets, simply::
41
41
42
42
$ pip install Flask-Sockets
43
-
44
-
43
+
44
+
45
45
Deployment
46
46
----------
47
47
@@ -61,12 +61,12 @@ supported, but gevent-websocket is recommended.
61
61
Development / Testing
62
62
---------------------
63
63
64
- Because the Werkzeug development server cannot provide the WSGI environ with
65
- a websocket interface, it is not possible to run a Flask app using the standard
66
- ``app.run() ``.
64
+ Because the Werkzeug development server cannot provide the WSGI environ with
65
+ a websocket interface, it is not possible to run a Flask app using the standard
66
+ ``app.run() ``.
67
67
68
- If you try to, Flask will still try to serve on all the specified routes, and
69
- throw a ``KeyError `` whenever a client tries to connect to a websocket route.
68
+ If you try to, Flask will still try to serve on all the specified routes, and
69
+ throw a ``KeyError `` whenever a client tries to connect to a websocket route.
70
70
71
71
Instead, just use the included gunicorn worker (explained above), or anything that
72
72
can insert ``wsgi.websocket `` into the WSGI environ.
@@ -80,3 +80,23 @@ The websocket interface that is passed into your routes is
80
80
`provided by gevent-websocket <https://bitbucket.org/noppo/gevent-websocket >`_.
81
81
The basic methods are fairly straitforward —
82
82
``send ``, ``receive ``, ``send_frame ``, and ``close ``.
83
+
84
+
85
+ Release History
86
+ ---------------
87
+
88
+ v0.2.0
89
+ ~~~~~~
90
+
91
+ - Add request context into the socket handler.
92
+ - Fallback to Flask logic if websocket environment is not available.
93
+ - Use Flask routing to allow for variables in URL
94
+
95
+ v0.1.0
96
+ ~~~~~~
97
+
98
+ - Initial release.
99
+
100
+
101
+
102
+
0 commit comments