When I try to run this, it gives the following error:
WebSocket transport not available. Install eventlet or gevent and gevent-websocket for improved performance.
When I try adding gevent/gevent-websocket to my dependencies, it just freezes when it tries to install it.
When I try adding eventlet to my dependencies, it installs it but when I run it it doesn't do anything, just freezes.
This works fine when I run it locally; I think this has something to do with Heroku being evil.
Thank you :)
Basically, long story short, Flask has its own development server. It is decent in many ways, but it is not asynchronous, so it cannot accept WebSockets. It can, however, accept Socket.IO, because it does not solely rely on WebSockets. Your application will work just fine, but it may be noticeably slower/less efficient. In order for
eventlet to work, you need to use a server that is not the development one (such as
gunicorn). If you are running this on repl.it, you just have to deal with this, unfortunately, because it is difficult to run any 3rd party servers. If your deploying to Heroku, have a look at their tutorial on Flask and WebSockets, which uses a different library than you, but I'm sure you can adapt it.
Also, unrelatedly, to get proper web output, change line 30 from