Thanks for this. A few months ago I looked into getting gevent-socketio up and running to do real-time messaging between a Flask app and an iOS app. gevent-socketio provides event handling and a messaging protocol on top of websockets that I thought would be useful.<p>However, based on my testing, in its current state it's nowhere near ready for production. There are some serious bugs relating to memory leaks, improperly closing stale sockets, and deployment on Gunicorn with # workers > 1 is not currently possible. (And in practice I don't think you would want to deploy on anything besides Gunicorn.) The project also seems to be somewhat inactive, there are a lot of open critical issues and there hasn't been any real activity in the last 6 months or so.<p>At this point I am considering removing the library and using a straight websocket implementation with a simpler protocol instead.
This looks like a thin wrapper over gevent-websocket. The code is slightly longer than the README: <a href="https://github.com/kennethreitz/flask-sockets/blob/master/flask_sockets.py" rel="nofollow">https://github.com/kennethreitz/flask-sockets/blob/master/fl...</a><p>Not to discredit the attempt to make gevent-websocket more accessible, but there's nothing really new here. Here's an example of using gevent-websocket with flask without this library:
<a href="https://gist.github.com/lrvick/1185629" rel="nofollow">https://gist.github.com/lrvick/1185629</a>
Websockets in python is easy.<p><a href="http://www.tornadoweb.org/en/stable/websocket.html" rel="nofollow">http://www.tornadoweb.org/en/stable/websocket.html</a>
Flask users will be grateful for support of web-sockets, because beginner in python can use flask & now flask-sockets too for building small but useful projects.
Thanks Reitz for this.
I've been using gevent-socketio for websockets with Flask. I'm new to python. Can someone tell me why I'd want to use this over gevent-socketio?