Created a websocket with Flask-io and gevent whenever sent a request to server it open and closes the connection immediately #1821
-
extension.py filesocketio = SocketIO(async_mode="gevent") flask_app. py filesocketio.init_app(app, cors_allowed_origins="*") run server viagunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker --bind localhost:5005 flask_app:app --workers=1 --threads=300 whenever I send a request to the server it opens a connection and closes immediately. @miguelgrinberg please suggest something |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Start by initializing the extension in a single place. If you want to use a direct initialization, then pass all your arguments to the |
Beta Was this translation helpful? Give feedback.
Start by initializing the extension in a single place. If you want to use a direct initialization, then pass all your arguments to the
SocketIO()
constructor. If you prefer the two-step initialization, then initializeSocketIO()
with no arguments, and pass all your arguments toinit_app()
.