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

Python SocketIO: BadNamespaceError: / is not a connected namespace

I am attempting to setup an app that streams your webcam on a website (by following this tutorial with some modifications). When attempting to set it up through SocketIO, I get an error: socketio.exceptions.BadNamespaceError: / is not a connected…
vernal123
  • 129
  • 9
3
votes
1 answer

SocketIO slowing on consecutive emit()

I'm trying to make a simple script to push events from a python app to a client. I made a Console React component, which uses SocketIO to receive the events, and I'm pushing the messages with Flask SocketIO. This is my app.py: from flask import…
Adcade
  • 151
  • 7
3
votes
1 answer

Logs showing Sending packet PING data None Received packet PONG data None continously in flask socketio

I have flask-socketio as backend and flutter as frontend. I am using flutter socket-io-client to connect to flask-socektio. It connects but I am receiving these continous messages on flask side Sending packet PING data None Received packet PONG…
user14713384
3
votes
1 answer

websocket page resetting on submit button press after timeout

I am having an issue where I have a page (A) that redirects to page (B) after doing some work in a flask websocket. Page (B) has another websocket that does more lengthy work 10-20 minutes and then has a button to continue to the third page (C)…
user1601716
  • 1,893
  • 4
  • 24
  • 53
3
votes
1 answer

load balancing/routing an application made with socketio and flask

I'm a bit of noob when it comes to deploying web apps and wanted to make sure a little app I'm building will work with the tech I'm trying to use. I have some experience with flask, but have only ever used the test server. My understanding is that…
CasualScience
  • 661
  • 1
  • 8
  • 19
3
votes
0 answers

Not able to stream vidoe from webpage to python server suing flask-socketio in python server and socetio in java script

I have been trying to stream video from the webpage to the python server and then process it in python and again send it back to the webpage. Unfortunately, I cannot send the video to the server from the web page. However, I can successfully stream…
bokey
  • 65
  • 3
3
votes
1 answer

Background Tasks in Flask-SocketIO

I have a pretty straightforward question, but I haven’t found a very straightforward answer: When should I use start_background_task() over starting a Python thread “normally”? Flask-SocketIO documentation states: This function returns an object…
star8163264
  • 148
  • 2
  • 8
3
votes
2 answers

Getting error - 'PngImageFile' object has no attribute 'shape' on transferring video frames from client to flask server using Socketio

My application is to switch on cam on the client-side, take the frame, perform the ML process on it in the backend and throw it back to the client. This part of the code (in bold) is throwing error - PngImageFile' object has no attribute…
Kumar
  • 33
  • 1
  • 4
3
votes
1 answer

Why SocketIO and SSLify not working together?

I built a very simple flask app that uses socketIo in order to make a simple chatapp, where you can write messages. In my js file i built a function that every few seconds sends the current location of the user using geolocation. Because im using…
Adi Portal
  • 55
  • 6
3
votes
2 answers

how to start flask_socketio app with ssl?

How should I translate app.run() to sockio.run() with SSL? I have below app start code to run with flask development server if __name__=='__main__': app.run(ssl_context=(ssl_cert, ssl_key)) I am now trying to start it with socketio like…
Kay
  • 1,235
  • 2
  • 13
  • 27
3
votes
2 answers

flask-socketio on uWSGI

I have this flask-socketio app (venv) ubuntu@ip-172-31-18-21:~/code$ more app.py from flask_socketio import SocketIO, send, emit from flask import Flask, render_template, url_for, copy_current_request_context from time import sleep from threading…
user8865059
  • 71
  • 2
  • 13
3
votes
2 answers

From origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

This is my first.py file. from flask import Flask from flask_socketio import SocketIO,send app=Flask(__name__) app.config['SECRET_KEY']='myscret' socketio=SocketIO(app) @socketio.on('message') def handlemessage(msg): print('Message:'+msg) …
Roshan Ojha
  • 111
  • 4
  • 13
3
votes
0 answers

Constantly dying workers Flask-SocketIO + uWSGI

I'm trying to implement sockets usage in my flask project and followed by flask-socketio documentation I had made it run perfectly with gunicorn, but found myself unable to make it work using uwsgi. It seems like it should be working even with the…
alexxmagpie
  • 367
  • 2
  • 10
3
votes
1 answer

Emit events from flask_socketio server on set intervals

I have a React Client which needs to consume messages emitted by a flask_socketio server, it works fine if I emit a single message on 'connect' however if i keep emitting it in a while loop it doesn't get picked up on the client-side. I presume it…
Sudheej
  • 1,873
  • 6
  • 30
  • 57
3
votes
0 answers

FlaskSocketIO retrieve list of all connected clients

I am just beginning to learn Flask SocketIO. The basic requirement is to gather all the client (along with info) that are connected to server. Below code is written to do just that. Username is collected on click of a button. #main.py from flask…
S Verma
  • 103
  • 2
  • 9