Flask-SocketIO: Flask-SocketIO doesn't work with eventlet
As soon as I install eventlet, my app stops working. I can still see logs and incoming connections, but I stop receiving messages and events from the client.
I reproduced this with the following code:
from flask import Flask
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
app.config['DEBUG'] = True
socketio = SocketIO(app)
@app.route('/')
def index():
return "Hello"
@socketio.on('message')
def test_message(message):
print "Received {}".format(message)
emit("echo", message)
if __name__ == '__main__':
socketio.run(app)
No changes in my client that just sends a “message” event and listens to “echo” events.
my pip-freeze:
eventlet==0.18.4
Flask==0.10.1
Flask-SocketIO==2.2
greenlet==0.4.9
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
python-engineio==0.9.0
python-socketio==1.2
six==1.10.0
Werkzeug==0.11.8
wheel==0.24.0
If I uninstall eventlet (pip uninstall eventlet) everything works fine. Is this some versioning problem? I couldn’t find anything like this online.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 9
- Comments: 26 (11 by maintainers)
After running
pip install eventletI getIs there something I’m not getting here?
Hi, even I am facing the same issue. Server side works normally but client side shows no activity yet all. Once I uninstall eventlet it starts working fine.
I think I need some help in running the code and getting it to deadlock. I was able to start the server, but then when I run the client there is a short exchange and the client exits.