miguelgrinberg / flask-sock

Modern WebSocket support for Flask.
MIT License
274 stars 24 forks source link

Make this the recommended replacement for flask-sockets? #22

Closed rmorshea closed 2 years ago

rmorshea commented 2 years ago

The popular flask-sockets project has recently been archived. It seems like this project should be its spiritual successor.

@edmorley, would it be appropriate to direct people to this project given that no one seems to have forked flask-sockets in order to continue maintaining it?

miguelgrinberg commented 2 years ago

Let me know if you have any questions.

edmorley commented 2 years ago

@rmorshea Hi! Sorry for the delayed reply.

I've added a link to this repo from from the description on https://github.com/heroku-python/flask-sockets and also as a comment on https://github.com/heroku-python/flask-sockets/issues/85.

Thank you for letting me know :-)

rmorshea commented 2 years ago

Great! Will close now.

nmz787-intel commented 2 years ago

what's the advantage of this over flask-sockets? I just got that working for my app with a proof of concept websocket:socket proxy for enabling the noVNC client in the browser. I'm wondering if this has any performance benefits that might help my VNC framerate. I'm using this to serve my Flask app, if that helps gevent.pywsgi.WSGIServer

miguelgrinberg commented 2 years ago

what's the advantage of this over flask-sockets?

Mainly that this is a maintained package, while flask-sockets is not.

Flask-Sock supports gevent, but that is not the only option, you have a few more ways to deploy your server, including one that uses standard Gunicorn threads instead of greenlets.

nmz787-intel commented 2 years ago

so in terms of performance, there's no advantage? Regarding gunicorn and greenlets, I don't really know the difference. Would one be more performant with respect to websocket handling? I'm not expecting more than 10 users... and even if my app is wildly popular, I doubt it would ever see more than a few hundred people at a time... and that's gonna take years to reach, in which time refactoring would be a definitely plan.

miguelgrinberg commented 2 years ago

The performance of your application will be largely dictated by the code that you write, not by the framework. If you are really interested in having a detailed comparison of performance between these two packages you will have to code your application in a way that allows you to switch, and then measure the performance and compare. Generic performance numbers are very misleading, and besides, Flask-Sockets has been abandoned for years, even if it was faster it is not a good idea to use it due to being unmaintained.