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
0
votes
0 answers

Flask socket IO with Gunicorn, Monitor all existing Greenlets, because of a WORKER_TIME_OUT

So I have a Flask socket IO application start with Gunicorn with the worker class : geventwebsocket.gunicorn.workers.GeventWebSocketWorker and with 1 worker. And, I have find that in a particular case i am getting a [critical] WORKER_TIME_OUT and…
Jbeat
  • 151
  • 2
  • 12
0
votes
1 answer

Emiting event after 'disconnect' is received by server (flask socketio)

I'm wondering if it's possible to emit something, in the 'disconnect' handler on server-side before the connection is actually cut or if it's already too late (in case the client disconnected, and in case the server disconnected). Cause I have a…
Valentin Coudert
  • 1,759
  • 3
  • 19
  • 44
0
votes
1 answer

Flask-SocketIO how to bridge communication of user with spawned process in event handler

My goal is to spawn process with another python script (which requires some shell interaction to enter auth code) after user clicks the button on the webpage. The register.py script has two possible shell outcomes, either it asks to input auth code…
radicz
  • 93
  • 8
0
votes
1 answer

How to structure Socket.io Authentication

I am creating an application using Flask-SocketIO at the server side and a javascript Socket.IO client. (There will also be a Python client later). I want to ensure users are authenticated before they connect to the web socket server. I have…
Lee Melbourne
  • 407
  • 5
  • 20
0
votes
2 answers

Socket IO Default Rooms

I would like to create a live notification center by using Web Socket in Python. I have a feature that send / emit a message to specific user. I have read about socket id and room. I think there are a couple way to do direct user interaction using…
Adityo Setyonugroho
  • 877
  • 1
  • 11
  • 29
0
votes
1 answer

Flask Socket IO doesn't receive messages

I am very new to web programming and to Flask Socket IO. I made a fast script to host with flask like this: from flask import Flask, render_template from flask_socketio import SocketIO app = Flask(__name__) app.config['SECRET_KEY'] =…
johanDa9u
  • 63
  • 5
0
votes
1 answer

flask-websocket emit in thread is broadcasting when it shouldn't

I have the following thread that emits to the websocket that is working, but if I have two browser windows ( or multiple clients connect) they all see the same data being pushed. In the example code from…
user1601716
  • 1,893
  • 4
  • 24
  • 53
0
votes
1 answer

celery start causes TypeError("unhashable type: 'list'",)

I am following the documentation for http://flask.pocoo.org/docs/0.12/patterns/celery/ and am getting the following error. $ python ./venv/bin/celery -A app.ctasks worker -c 8 -l INFO [2018-04-19 08:45:03,623: ERROR/MainProcess] Unrecoverable error:…
user1601716
  • 1,893
  • 4
  • 24
  • 53
0
votes
0 answers

When connecting with flask-socketio get an error when loading html source files

I am using socket.io js (client) and connecting to flask-socketio (server). The connection occurs, but I get an error in python when loading source files in my HTML. So it tried to first load the source files and then make the socket connection: …
Dave
  • 147
  • 1
  • 8
0
votes
1 answer

flask socketio with database communication

what i am trying to do is the next: First connection is made by the cliente ("connect") Then from the Python, i call the function which depending on the info in database, makes an emmit to another "socket" (test). But my problem is, when there is…
Abdullah Awan
  • 11
  • 1
  • 4
0
votes
1 answer

Combining socketio and simple web server in same app using background task

I have this script: from flask import Flask from flask_socketio import SocketIO, send app = Flask(__name__) socketio = SocketIO(app) def run_server(): socketio.run(app) @socketio.on('message') def handleMessage(msg): print('Message: ' +…
Inbar Cheffer
  • 2,109
  • 1
  • 7
  • 8
0
votes
0 answers

Flask-SocketIO ERROR - timed out in Windows Service

I'm trying to create Windows Service using Flask-SocketIO. I'm working on Windows 10 Enterprise with Python 2.7.13 and Flask-SocketIO 2.8.6. I'm able to create Windows Service with a name "TestFlaskService". But when I start this Windows service,…
0
votes
1 answer

Flask-SocketIO connection gets interrupted when code execution takes too long

Hi my conversion finished stops arriving on the client side once the code execution takes too long. This works: @socketio.on('nifti_conversion') def handle_message(message): elehelper.send_status({'code': 201, 'message':'conversion started!'}) …
florian
  • 604
  • 8
  • 31
0
votes
0 answers

Data only logging to console after closing websocket using socket.io

TL;DR: I'm working on an application using PRAW, Flask, Flask-SocketIO on the back end and the SocketIO JS library on the front end to live-stream reddit comments as they happen. I have a websocket configured to send an authorization code to the…
cass
  • 858
  • 1
  • 10
  • 17
0
votes
1 answer

Flask-SocketIO: Sending messages back to client

I am currently trying to implement a Twitter Stream using Twitter's Streaming API and I am using Flask-SocketIO for use in Python. Now I am able to send an emit to trigger a function in Flask which calls the Twitter API based on some keyword, but I…
apgsov
  • 794
  • 1
  • 8
  • 30