I am using socket io and flask application.Everthing works except I always get this message. This is my initialization:
app = Flask(__name__)
app.config['SECRET_KEY'] = APP_SECRET_KEY
jwt = JWTManager(app)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
# app.config['transports'] = 'websocket'
socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading')
socketio.run(app, debug=True)
What may cause this warning and what does it mean?
The console looks like this:
If it's the problem occurred when executing a python file
Just try pip install eventlet
its worked for me you can also try pip install gevent
some times this can also do the trick!
Normally you do not include the async_mode
option when you instantiate your server. By having async_mode='threading'
you are forcing the server to ignore eventlet and/or gevent and go with the more basic server, which does not support WebSocket.
So remove async_mode
, then install eventlet (or gevent and gevent-websocket). Now your server will have access to WebSocket and will not show the warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With