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
3
votes
1 answer

Socket.IO Emit Sending in Delay

I'v created a Flask-SocketIO python server that should log data from a socket.io JavaScript client. Server: from flask import Flask, render_template from flask_socketio import SocketIO app = Flask(__name__) socketio =…
Michael
  • 796
  • 11
  • 27
3
votes
3 answers

How can I avoid to use global variables? (python - flask-socketio app)

I'm trying to figure out how to not use global variables for my application but I can't think of anything else. I'm actually coding a web interface with the help of the Flask-SocketIO module to interact in real time with a music player. This is a…
F. Rossi
  • 43
  • 2
  • 6
3
votes
1 answer

Flask-SocketIO trouble with sid and namespaces

Flask-SocketIO is giving me some trouble. I am trying to initialize private chat rooms with the following code: @socketio.on('join', namespace='/join') def on_join(receiver_name): username = session['username'] join_room(receiver_name) #…
peachykeen
  • 4,143
  • 4
  • 30
  • 49
3
votes
1 answer

How to wait for a callback passed to Flask-SocketIO's emit()?

Is there a way in Flask-SocketIO to have a blocking/synchronous emit('event', callback) function that waits for the callback passed to it before returning? Or -- is there a way to directly invoke the callback in an @socketio.on('event') handler…
Bloke
  • 2,229
  • 3
  • 22
  • 27
3
votes
1 answer

How do I fix this KeyError error using Flask-SocketIO?

This seems to be a common problem when I search around, but I can't seem to find a viable resolution. The error is not very helpful as far as I can tell as it doesn't really tell you why the saved session is gone. Traceback (most recent call…
Kenny Powers
  • 1,254
  • 2
  • 15
  • 25
3
votes
1 answer

How can I wait for Socket.IO to have a socket connection established before connecting a user to the server?

I'm running SocketIO-Client-Swift in order to open WebSockets and communicate with a server. However the problem I'm having is that I want to connect to the socket and then connect to the server with an…
user6190673
3
votes
1 answer

Python SocketIO emitting event after server creation

I have a web project using php and a python script which modifies folders. I want to execute some javascript on the website based on eg. a folder creation done in the python script. My idea was to work with python socketio. I have the basic…
rambii
  • 451
  • 4
  • 11
3
votes
2 answers

How to access formData in flask sent using websockets?Flask-SocketIO

How to access form data sent to Flask using web sockets? I receive invalid frame header in google chrome developer tools->console. Extract from my javascript code: var form_data = new FormData($('#my_form')[0]);…
3
votes
1 answer

Python Flask SocketIO broadcasting outside of @socketio context

I'm trying to send a broadcast when an outside value changes. Camonitor calls the callback when the value changes, and I want to notify all connected clients that the value has changed and they need to refresh. from flask import Flask from epics…
user109419
  • 31
  • 3
3
votes
2 answers

Flask - Pulling the live stream kafka data - Integrating Kafka with Python Flask

This project is for real time search engine - log analysis performance. I have a live streaming data out from Spark processing to Kafka. Now with the Kafka output, I want to get the data from the Kafka using Flask.. and visualize it using Chartjs…
3
votes
1 answer

Server to Server Communication

I'd like to know if there's a way to communicate directly between two (or more) flask-socketio servers. I want to pass information between servers, and have clients connect a single web socket server, which would have all the combined logic and data…
Phil
  • 33
  • 1
  • 4
3
votes
1 answer

how to keep alive in flask-socketio?

there is a error in my flask project. The socketio client often disconnects to my flask-socketio server. They will reconnect some minutes after. I want to keep the connect always alive, how can i do? How can I to fix this bug? Traceback (most recent…
huiji_Leung
  • 41
  • 1
  • 2
3
votes
1 answer

Unable to emit after rabbitmq channel.start_consuming() call in flask-socketio handler

I'm trying to listen to a rabbitmq queue from within a flask-socketio event handler so I can send realtime notifications to a web app. My setup so far: Server import pika import sys from flask import Flask, request from flask_socketio import…
Troy
  • 1,799
  • 3
  • 20
  • 29
3
votes
2 answers

How to run flask socket.io on localhost (xampp)

The tutorials I have seen use the following code to run the server: if __name__ == '__main__': socketio.run(app) My __init__.py file is: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.orm import…
user2268507
3
votes
1 answer

How to implement SSL(http to https) using Flask, Flask-SocketIO and nginx

My application uses Flask-Socketio, Flask and nginx. I read in a post that all HTTP to HTTPS handling must be done at Web Server level and not at Application Server level. I used the rewrite attribute to redirect all HTTP requests as HTTPS requests.…
Neeleshkumar S
  • 746
  • 11
  • 19