I know how to receive data from POST request in main thread: But can I do that in background thread to avoid blocking UI (rendering index.html)? Answer I’m assuming you want the html rendering and processing of your request to run concurrently. So, you can try threading in Python https://realpython.com/intro-to-python-threading/. Let say you have a function that performs some processing
Tag: flask-socketio
flask web socket not connecting
i am trying to connect websocket in flask(1.1.2) with Flask-SocketIO(5.0.1) but it give 400 error to websocket url. i`m using anaconda virtual environment. my requirements.txt is – amqp==5.0.3, bidict==0.21.2, certifi==2020.12.5,click==7.1.2, dnspython==1.16.0, eventlet==0.30.0, Flask==1.1.2, Flask-SocketIO==5.0.1, gevent==21.1.1, gevent-websocket==0.10.1, greenlet==1.0.0, importlib-metadata==3.4.0, itsdangerous==1.1.0, Jinja2==2.11.2, kombu==5.0.2, MarkupSafe==1.1.1, python-engineio==4.0.0, python-socketio==5.0.4, six==1.15.0, typing-extensions==3.7.4.3, vine==5.0.0, Werkzeug==1.0.1, zipp==3.4.0, zope.event==4.5.0, zope.interface==5.2.0 Answer It’s because of version compatibility, you should either
Socketio rooms – how to get list of ALL rooms
I’m getting familiar with socket io using Flask-Socketio library. I would like to create some kind of chat app/message board. You can create rooms, join rooms and chat with other people in that room. In order to join an existing room, I would like to get a list of all existing rooms on the server side. So the user can
(flask + socket.IO) Result of emit callback is the response of my REST endpoint
Just to give a context here, I’m a node.JS developer, but I’m on a project that I need to work with Python using Flask framework. The problem is, when a client request to an endpoint of my rest flask app, I need to emit an event using socket.IO, and get some data from the socket server, then this data is