flask-sock
flask-sock copied to clipboard
How to extend this to work with uWSGI?
Hi, my understanding is that this only works with the Flask dev server, and with gunicorn.
How can one extend this to work with uwsgi
too?
I got flask-socketio
working with uwsgi
(and gevent
) doing something like:
uwsgi --module app:app --touch-reload app.py --master --http :8000 --http-websockets --gevent 1024
but (unsurprisingly) the same thing doesn't work with flask-sock
, probably because support for uwsgi
needs to be specifically implemented. (But how?)
You are correct, I have not implemented uWSGI support in this package. Flask-Sock uses its own WebSocket implementation (provided by the wsproto package) instead of relying on the web server's own WebSocket support. With uWSGI I'm not sure it is possible to use a custom WebSocket implementation. Gunicorn, Werkzeug, Eventlet and Gevent make it easy, so that is why these are the solutions I have implemented.
Thank you for the reply. And the tutorials.