Questions tagged [flask-socketio]

Flask-SocketIO lets Flask python applications access low latency bi-directional communications between the clients and the server

Flask-SocketIO is an open source library which implements the abstraction, for delivering low latency client-server communication in a application developed by Miguel Grinberg.

1052 questions
31
votes
3 answers

Python - Flask-SocketIO send message from thread: not always working

I am in the situation where I receive a message from the client. Within the function that handles that request (@socketio.on) I want to call a function where some heavy work is done. This should not result in blocking the main thread and the client…
Schnodderbalken
  • 3,257
  • 4
  • 34
  • 60
27
votes
1 answer

flask socketio emit to specific user

I see there is a question about this topic, but the specific code is not outlined. Say I want to emit only to the first client. For example (in events.py): clients = [] @socketio.on('joined', namespace='/chat') def joined(message): """Sent by…
shell
  • 1,867
  • 4
  • 23
  • 39
24
votes
7 answers

The client is using an unsupported version of the Socket.IO or Engine.IO protocols Error

I'm trying to run a client an server in python using flask_socketio, socketIO_client and SOCKET.IO in a raspberry pi 4 but I'm getting the following error: The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further…
stracc
  • 507
  • 1
  • 4
  • 10
21
votes
3 answers

Error: class uri 'eventlet' invalid or not found

I've been running a dockerized flask application that uses Celery to run tasks. To run the app I'm using gunicorn with eventlet and It's been working fine using alpine linux distribution. However I had to move to ubuntu due to some issues with…
magnoz
  • 1,939
  • 5
  • 22
  • 42
19
votes
1 answer

Flask: A RESTful API and SocketIO Server

Background I am trying to create a simple REST API using the Flask-RESTful extension. This API will be working primarily to manage the CRUD and authentication of users for a simple service. I am also trying to create a few web sockets using the…
nmagerko
  • 6,586
  • 12
  • 46
  • 71
18
votes
3 answers

WebSocket transport not available. Install eventlet or gevent and gevent-websocket for improved performance

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']…
MD10
  • 1,313
  • 3
  • 12
  • 35
16
votes
2 answers

TypeError: object NoneType can't be used in 'await' expression

function i am trying to call from my flask-socketio server from flask_socketio import emit import asyncio async def myfunc(): for i in range(10): j = 1*3 await emit('update', {'j':j}) in my server function i am running loop…
daas-shukla
  • 171
  • 1
  • 2
  • 7
15
votes
4 answers

Systemd: Start operation timed out. Terminating

I'm trying to create an autostart service for my python-flask-socketio server. I need to start a python script through systemd. Here's my service code: [Unit] Description=AppName [Service] Type=forking ExecStart=/usr/bin/python3…
Nix
  • 465
  • 1
  • 7
  • 16
13
votes
2 answers

Responding to concurrent requests with Flask and eventlet

I try to set up a minimal Flask application that uses eventlet to respond to concurrent requests instantly instead of blocking and responding to one request after the other (as the standard Flask debugging webserver does). Prerequisites: pip install…
Dirk
  • 9,381
  • 17
  • 70
  • 98
12
votes
2 answers

How to stream live video frames from client to flask server and back to the client?

I am trying to build a client server architecture where I am capturing the live video from user's webcam using getUserMedia(). Now instead of showing video directly in
akan
  • 421
  • 1
  • 4
  • 13
12
votes
1 answer

Unrecoverable error: ResponseError('UNBLOCKED force unblock from blocking operation, instance state changed (master -> replica?)

I'm using a redis docker container to be used as a message/ broker queue for celery and flaskk-socketio in my python app and lately my redis instance is crashing pretty often, and it doesn't come back. I'm not a redis expert and I couldn't yet find…
magnoz
  • 1,939
  • 5
  • 22
  • 42
12
votes
1 answer

threading=True with flask-socketio

I have been using flask, and some of my route handlers start computations that can take several minutes to complete. Using flask's development server, I can use app.run(threaded=True) and my server will continue to respond to other requests while…
Bruce Sherin
  • 179
  • 1
  • 8
12
votes
1 answer

How to emit websocket message from outside a websocket endpoint?

I'm building a website using Flask in which I also use Websockets using Flask-socketIO, but there's one thing I don't understand. I built a chat-functionality. When one user sends a message I use websockets to send that message to the server, after…
kramer65
  • 50,427
  • 120
  • 308
  • 488
11
votes
1 answer

Using eventlet to manage socketio in Flask

I am trying to set up a small server to handle HTTP and socketio requests -- I don't have much experience setting up servers, but right now apache2 serves the http just fine. The socketio transactions, however, keep failing with error code 400 (bad…
zeck
  • 113
  • 1
  • 1
  • 5
11
votes
1 answer

How can I send a message from a flask route to a socket using flask-socketio

I have the following scenario I would like to implement: User surfs to our website User enters a bitcoin address. A websocket is created to the server, passing the address. The server registers a callback with Blocktrail When the callback is…
DDecoene
  • 7,184
  • 7
  • 30
  • 43
1
2 3
70 71