235 questions
0
votes
1
answer
51
views
Socketio background task issues with pubsub subscription
I am running a gunicorn server with 1 eventlet worker through which I communicate with the FE via websockets.
However, I also need to listen to an external pod running some code that will emit a redis ...
0
votes
1
answer
227
views
Server.emit() got an unexpected keyword argument 'broadcast' with Flask-SocketIO
Note: There is a discussion at GitHub but nothing was concluded.
I am getting error - "Server.emit() got an unexpected keyword argument 'broadcast'" after python update from 3.8 to 3.11 in ...
0
votes
0
answers
29
views
python server / JS client: socketio regular disconnects
In trying to reproduce errors from a larger project I have created a server using python's aiohttp and the following python-socketio (v5.12.0) namespace:
class MyNamespace(AsyncNamespace):
...
0
votes
0
answers
41
views
RevPi connection using Websockets
I am trying to connect a revpi to a windows pc to exchange input events using websockets. The server(revpi) looks as such:
@app.route('/init', methods=['GET'])
def initialize():
rpi.io.O_Unlock....
0
votes
0
answers
480
views
FastAPI 'reload' hangs and the application does not restart
I recently added sockets to my application, and since then the reload no longer works but gets stuck in the 'Shutting down' status
Here is a screenshot of the logs in the application.
Capture logs ...
3
votes
1
answer
1k
views
FastAPI RuntimeError: Expected ASGI message 'websocket.accept', 'websocket.close', or 'websocket.http.response.start' but got 'http.response.start'
I have server like:
main.py
import socketio
from fastapi import FastAPI
app = FastAPI()
sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins="*")
sio_app = socketio....
0
votes
1
answer
84
views
flask-socketio server not connect to python-socketio client by polling
Q: I have a flask server application by flask-socketio, it is :
from flask import Flask
from flask_socketio import SocketIO
app = Flask(__name__)
# CORS(app, supports_credentials=True)
app.config['...
0
votes
0
answers
132
views
Why Flask-SocketIO ends with 'Invalid session error'?
I'm testing the Flask-SocketIO package. My config is:
Server: Synology NAS DS218J (unix) on local network, running the basic example over Python 3.9.14.
Python script running on server:
from flask ...
0
votes
1
answer
55
views
Python sockio SimpleClient fails to connect to python-socketio
I've got a python backend with python-socketio as server. I have a react application which can connect to it just fine. However, my python client app always raises a 'connectionError'.
I need some ...
0
votes
1
answer
637
views
Flask Blueprint with socketio configuration
My problem 🥲
I have a Flask app that I recently separated into blueprints as it grew in size.
All of the app migrated well except for one thing - socketio.
My goal is to have a socketio background ...
0
votes
0
answers
65
views
Extra 0x00 at the start of TLS Client Hello packet, how to remove it?
I'm working on a Python proxy server that needs to receive TLS Client Hello data from a browser and forward it to the target server. However, I've noticed that the Client Hello packet sent by my proxy ...
1
vote
2
answers
157
views
How should I correctly configure tasks when using sockets in python?
I have this small snippet which I intend to have function as a server, I have managed to get the socket to connect to the client but cannot send data due to errors.
import asyncio
import json
import ...
0
votes
2
answers
92
views
Socket IO is rejecting requests from Nginx proxy
I have this docker application running several containers. One of these containers is a Python application that can handle both socket io requests and normal HTTP requests. Django's ASGI handles HTTP/...
0
votes
1
answer
99
views
Gunicorn multiple workers + drf + socketio have only one connection
I am using socket-client using python-socketio in django-rest-framework. And drf is running as gunicorn on the centOS server with 3 workers. When I start my service, I can see only one connection. So ...
0
votes
1
answer
95
views
Trouble connecting to Ambient Realtime API using Python
I'm trying to connect to the Ambient Realtime API using Python and the socketio library, but I'm encountering an exception that states
socketio.exceptions.ConnectionError: One or more namespaces ...
0
votes
1
answer
97
views
Flask-SocketIO v5.2.0 join_room sid key error when using python-socketio v5.11.2
python-socketio v5.11.2 is causing my flask server (Flask-SocketIO v5.2.0) to create a key error when invoking join_room.
Client first connects, then returns a key error when joining a room.
It seems ...
1
vote
1
answer
119
views
FFMPEG stream from python to browser using socketio
I want to show the video on the browser streamed by ffmpeg.
Here's the python script which i made but can't find the way to do so since i am not much into javascript. Can anyone help me please ?
...
0
votes
0
answers
108
views
How set an autoreload on my `socketio.ASGIapp` plugged on my FastAPI app?
I have an app combining FastAPI and SocketIO ASGI. On code change, the FastAPI reloads but not the SocketIO one. Is there a way to tell SocketIO to reload on change without using watchdog ? By setting ...
0
votes
0
answers
40
views
SocketIO (python) make same iteration slower
I have a function called doCalibrate() which does iteration to move the stepper (GPIO Raspberry), let's say normally this function runtime is only 3 seconds.
This script was called from 2 source
...
-1
votes
1
answer
89
views
SocketIO Java client not connecting
I am attempting to create a simple connection between a python SocketIO server on repl.it and an Android Java app. When I attempt to connect to the socket nothing is happening.
Client:
Socket socket;
...
2
votes
0
answers
276
views
Trouble with using python-engineio, python-socketio and Flask-SocketIO in my Python flask application
I am currently developing a flask application with Python and have a few different requirements.
First off, I need to implement a websocket server in order to have real time communication with clients ...
0
votes
0
answers
140
views
code 400, message Bad request version in Python socketio server
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client.
when i use the http it works fine client is able to connect to ...
1
vote
2
answers
300
views
Trouble sending data from Socket.IO server to client in Python
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client. Despite successful connections between the client and server, I'm ...
0
votes
0
answers
235
views
Random ConnectionError using python-socketio on the client side
I am using python-socketio to connect to a third party server using the socketIO protocol.
The server is out of my control, therefore I do not have access to server side logs, etc... .
The error below ...
0
votes
1
answer
68
views
Python client socketio cannot connect to nodejs server socketio
I am trying to connect python client using python-socketio with nodejs express server using socketio. I am able to connect python client with python server using python-socketio. I have already ...
0
votes
0
answers
133
views
Issue with python-socketio catch-all namespaces
I have the latest version (5.11.0) of python-socketio installed.
I was able to get catch-all events working,
@sio.on('*')
async def handle_event(event, sid, *args):
I'm following the example/syntax as ...
0
votes
1
answer
167
views
Accessing Flask application context within python-socketio Client()'s event handler
I am trying to access Flask application context inside the python-socketio's event handler on_tick(), and I am presented with error -
(...)
File "H:\Python\autotrader2\venv\lib\site-packages\...
0
votes
0
answers
186
views
connect with proxy in python-socketio
I am using python-socketio and I want to use a proxy (http proxy) in socketio, but I cannot figure out how to do that. I've searched, but I don't know enough to find the answer...
For example, is ...
0
votes
0
answers
383
views
Connection Error in python-socketio (exceptions.ConnectionError(exc.args[0]) from None)
i write a code and use python-socketio and it works fine.
but sometimes(i mean every 10 or 20 run) i get the error below:
sio.connect(URL, transports=["websocket"], wait=False) File "/...
0
votes
2
answers
526
views
python-socketio connecting to server, but is blocked (not executing anything)
I am making a sort of an IT automation system, that will let the admin, manage, say around 40 computers. I am using React for Frontend, NodeJS as server (acting as an intermediatory), and a Python ...
0
votes
1
answer
384
views
Running a background task with python asyncio
I am building a websocket server in which I want to have a background task that receives messages from SQS and sends them to client while not blocking rest of the events.
But I keep getting this error,...
1
vote
1
answer
446
views
How to dynamically add socketio event handler with a given string
I have python-socketio server and client. When server calls client with event name, such as 'ping_client', client will emit back event 'ping_client_response' after receiving 'ping_client' event from ...
0
votes
1
answer
262
views
Pythonic way to process a synchronous event (callback) in an async environment
I'm looking for a solution with which I could use the Python socketIO disconnect event and forward this into a fully asynchronous host class.
@self._sio.event
def disconnect():
''' ...
0
votes
0
answers
221
views
The size of gevent/eventlet pool with python-socketio in production
Context
Right now I have a simple production setup of python-socketio served on top of eventlet according to the documentation.
This application interacts mainly with Redis using official redis-py ...
0
votes
1
answer
2k
views
Emitting event from client to server using python-socketio is extremely slow
I'm using python-socketio for the first time, I have a simple AsyncServer that looks like this.
import socketio
from aiohttp import web
sio = socketio.AsyncServer()
app = web.Application()
sio.attach(...
1
vote
1
answer
281
views
Syncing issue within Socket IO
I've implemented a website chat with python-socketio and socket.io-client.
At times, when we simultaneously open multiple tabs in different browsers or incognito sessions with the same logged-in user, ...
1
vote
0
answers
366
views
Sending audio stream usign asyncio
I'm trying to stream microphone data to an asynchronous server. The client code is below. My first attempt was without using await asyncio.sleep(0), but the code was getting blocked. I imagine it was ...
0
votes
0
answers
895
views
Socket IO client keeps disconnecting / aborting
I'm working on making a simple socket IO quiz bot but it keeps disconnecting and giving an error packet queue is empty, aborting and i can't work out why.
The logs:
Attempting WebSocket connection to ...
0
votes
1
answer
87
views
Flask-RESTful with Flask-SocketIO
I have problem to implement my Flask-RESTful application with Flask-SocketIO. Any ideas how to configure both? Here is my code:
from decouple import config
from flask import Flask
from flask_cors ...
1
vote
1
answer
693
views
Cannot connect to Socket IO server (400 error)
I cannot connect to my Socket IO server after uploading and configuring on the server. It is giving 400 error:
Error: Unexpected server response: 400
My server: Rocket Linux. Using Nginx. Socket Io ...
0
votes
0
answers
153
views
Possible Bug with Multiprocessing and Flask SocketIO
I'm trying to use flask-socketio to handle the communications between a server and a client.
The server code can be boiled down to this:
from multiprocessing import Process, freeze_support
import ...
0
votes
1
answer
382
views
socket.io client does not receive events
I have a SvelteKit application that is using the socket.io client, and a python application that is using the python-socket.io server with eventlet.
The problem is, that messages from the server to ...
0
votes
1
answer
2k
views
The Socket.IO mounted on FastAPI app works fine when mounted on the root route ('/'), but encounters issues when changing it to '/ws'
The Socket.IO app, which is mounted to the FastAPI app on the root route ('/'), is functioning correctly. However, when I attempt to change the route from the root ('/') to '/ws', the Socket.IO ...
1
vote
0
answers
151
views
Flask eventlet Dispatchermiddleware SSL
I have this Python code and i want to use SSL for the connection.
import socketio
from eventlet import listen, wrap_ssl
from eventlet.wsgi import server
from flask import Flask
from werkzeug....
0
votes
0
answers
131
views
Binding Flask-SocketIO server to random port and retrieve address
First, thank you for this amazing library! Second, my apologies if this was somewhere in the documentation, I was unable to find a clean way to do what I want to do. I am very new to the project and ...
0
votes
0
answers
259
views
Using Django (+DB), Gunicorn, and Socketio, I cannot access Django database from multiple threads
I'm attempting to set up the traditional Django deployment stack (Django, Gunicorn, NGINX). I am also using socketio, similar to the example in the python-socketio documentation.
Unfortunately, the ...
0
votes
0
answers
153
views
WSGI Server for Django + Python-Socketio
I have a Django server, that also has a socketio component using python-socketio library. I'm trying to produce a relatively simple but production ready deployment for it on an Amazon EC2 Instance. I'...
0
votes
2
answers
793
views
How to correctly install dependencies in MicroPython interpreters
I'm using Thonny, if there are better IDE's for working with python on microcontrollers definitely open to suggestions.
I have a node.js server using socket.io and express websocket server, that is ...
0
votes
1
answer
723
views
Emit or call client outside of event handler with socketio
I tried to pass the sio instance to another class and send some calls from there to the client and when finished return back to the process_msg function.
But I guess since this is an async function, ...
0
votes
1
answer
531
views
How can I render new Template with Flask Socket-IO join event?
I'm programming a litte multiplayer game with Flask Socket-IO. If the client is on the website, he connects to the websocket. On the start page the client should type a nickname in the field and press ...