Flask-SocketIO - WebSocket is closed before the connection is established. [Heroku] #1708
-
While running Flask on my local server everything was fine, but after moving to Heroku I started getting "WebSocket is closed before the connection is established." Heroku Logs
python server
client
Procfile
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Do you see the discrepancy? You are running Gunicorn with the gevent-websocket worker, but Flask-SocketIO thinks it is configured to use eventlet:
Which one do you want to use? If you want gevent, then add |
Beta Was this translation helpful? Give feedback.
Do you see the discrepancy? You are running Gunicorn with the gevent-websocket worker, but Flask-SocketIO thinks it is configured to use eventlet:
Which one do you want to use? If you want gevent, then add
async_mode='gevent'
to yourSocketIO()
object, to override the default. Or as an alternative, make sure eventlet is not installed in your virtualenv, and then Flask-SocketIO is going to go with the next option, which is gevent.