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

Flask, SocketIO, and Docker net::ERR_CONTENT_LENGTH_MISMATCH

I have a Flask app that is only ever deployed as a local service that continuously puts out this error, in the browser console, and fails to load content. The app is basically a media collection and distribution service. I understand that there is a…
chonigman
  • 41
  • 4
4
votes
2 answers

How to setup flask-socketio in a docker container?

Hello I'm trying to setup flask-socketio in a docker container. It seems to run but I get an error( from the browser) when I try to access localhost on port 5000 like I'm used to do with flask apps. It say's: unable to connect! I will show you the…
The Fool
  • 16,715
  • 5
  • 52
  • 86
4
votes
1 answer

Python Flask-socketio working, not receiving data from JS client

I am trying to setup a basic web socket using flask-socketio and the javascript socket-io library on the front end. The frontend successful registers the connection. However, in the python console, my log messages are not working and there is no…
4
votes
0 answers

Google Speech API from client micro stream : data format

I'm trying to adapt this Java codeLabs to Python / SocketIO (Flask Socket IO on server side). My socket is working, I'm able to pass both the sample rate (and to retrieve on server side), and the audio data. The problem is that the format of my…
Valentin Coudert
  • 1,759
  • 3
  • 19
  • 44
4
votes
1 answer

Basic flask-socketio implementation not working; no output or errors

I'm trying to incorporate socketio with my flask project. Right now I am trying to get a simple "Connected" or "Disconnected" output from the server. However when I run the app script with "python app.py" I don't get these messages nor any errors…
SorenLantz
  • 177
  • 2
  • 14
4
votes
1 answer

How can I test a SocketIO server connection (with pytest or any other package)?

Currently, I´m working on a tool which shows the current price of one Bitcoin. Every minute, the price is updating with making a request with SocketIO which emits then the current price. Now my issue is that I want to test the connection of the…
julianYaman
  • 310
  • 4
  • 13
4
votes
0 answers

SocketIO client is not receiving Flask-SocketIO's PONG messages

I am running a Flask app behind Gunicorn and nginx (and Cloudflare, if that matters). I've recently tried to add SocketIO functionality, however have come across a problem. I'm using eventlet as the asynchronous service. The websocket connection…
user1814016
  • 2,273
  • 5
  • 25
  • 28
4
votes
1 answer

Is Flask-SocketIO's emit function thread safe?

I have a Flask-SocketIO application. Can I safely call socketio.emit() from different threads? Is socketio.emit() atomic like the normal socket.send()?
hefeicoder
  • 123
  • 1
  • 7
4
votes
1 answer

Serving static resources with Flask - running afoul of Same-origin policy

I’m having trouble serving static files (image assets, etc.) for a small game I’m working on in Phaser. I’m using flask-socketio on the server (and socket.io on the client-side) for networking which is why I’m trying to get this working under…
user45183
  • 529
  • 1
  • 7
  • 16
4
votes
0 answers

Confused on proper implementation of Flask blueprints and socketio

I have a Flask app that I have restructured to leverage blueprints. The application runs and everything seems to be going ok except for SocketIO and my socketio.on events. I never see SocketIO and the web socket attempt to connect or disconnect in…
user982599
  • 975
  • 13
  • 28
4
votes
1 answer

Flask and Flask-SocketIO integration and import errors

I am trying to integrate Flask-SocketIO with my Flask application. For some reason I am getting an import error that is triggered by the from .. import socketio that I have in my events.py and I am not sure why. I would greatly appreciate any help…
user982599
  • 975
  • 13
  • 28
4
votes
1 answer

Flask-Socketio: namespace keyerror., get list of connected clients

I am using Flask-Socketio on my server that is running Flask and my clients run javascript. All my clients connect to the server using the namespace '/test'. Upon a certain action on the client, I want the client to trigger a function on the server…
yatishby
  • 73
  • 1
  • 6
3
votes
1 answer

Flask-Socketio emitting from an external process

I've been working on a project using flask, flask-socketio and redis I have a server, and some modules I would like to be able to emit from outside of the server file. server.py from flask import Flask, Response, request, json from flask_socketio…
SpeedOfRound
  • 1,210
  • 11
  • 26
3
votes
0 answers

How to serve Flask app on waitress and socket.io using eventlet server simultaneously?

I'm using waitress server to deploy the flask app for production. I'm also using flask's socketio along with the eventlet server which requires its own app run. Currently only serving app on waitress: serve(app, host='0.0.0.0', port=8080) How do I…
Liz
  • 31
  • 3
3
votes
0 answers

Flask-SocketIO WebSocket transport is not available

I've got a Flask server with Flask-SocketIO to do instant reloads on some pages. Now I'm getting this message in the console: The WebSocket transport is not available, you must install a WebSocket server that is compatible with your async mode to…