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.

845 questions
27
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
  • 2,194
  • 3
  • 20
  • 47
17
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,647
  • 2
  • 17
  • 31
17
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
  • 5,616
  • 9
  • 38
  • 71
11
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
  • 7,235
  • 15
  • 56
  • 86
10
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
  • 101
  • 1
  • 6
9
votes
1 answer

Running Websockets with Google Cloud Platform

I have a flask app that runs both flask and flask-socketio endpoints. When i went to deploy on google App engine, i realized that websockets are not supported by app engine. this means that i need to use compute engine for my flask-socketio and app…
9
votes
2 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
  • 175
  • 1
  • 2
  • 15
8
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
  • 183
  • 2
  • 11
8
votes
0 answers

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,303
  • 1
  • 14
  • 32
8
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
  • 83
  • 1
  • 1
  • 4
8
votes
2 answers

Heroku sock=backend Server Request Interrupted for a Flask SocketIO application

I have a flask-socketio app hosted on heroku with the following Procfile : web: gunicorn --worker-class eventlet hello:app Ever since I switched to socketio, the app has been behaving inconsistenly. Earlier the app would run for a while and then…
Denny George
  • 485
  • 1
  • 5
  • 16
8
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…
Dennis Decoene
  • 6,718
  • 5
  • 26
  • 41
8
votes
1 answer

Flask SocketIO send message from server to room

In my app, I need the client to join a room so that it may then receive messages from my server. Server Code @socketio.on('join', namespace='/test') def join(message): join_room(message['room']) room = message['room'] emit('my…
user2268507
8
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
  • 39,074
  • 90
  • 255
  • 436
7
votes
2 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
  • 814
  • 6
  • 16
1
2 3
56 57