Python implementation of the Socket.IO realtime client and server.
Questions tagged [python-socketio]
137 questions
3
votes
1 answer
python socketio communication with ssl related problem
I am using python socketio for communication and it works well for http. Have a problem when upgraded it to work with SSL.
I made a self-signed root certificate (CA), and issued server.cert and server.key. I told the computer to trust the CA. After…
Tyrion
- 175
- 1
- 13
3
votes
2 answers
python-socketio vs Gevent-socketio
I am choosing a python library to write a live-chat function page embed in my website.
I found two libraries that based on Socket.IO, python-socketio and gevent-socketio:
From python-socketio doc:
Python implementation of the Socket.IO realtime…
aircraft
- 16,211
- 16
- 74
- 135
2
votes
0 answers
Expected ASGI message 'websocket.accept' or 'websocket.close', but got 'http.response.start'
I want to connect websockets, but I get an error at startup.
uvicorn app:app --reload --ws websockets
requirements
OS: Linux Ubuntu 20.04 LTS
Python 3.8.6
Browser: Chrome…
Dima
- 130
- 6
2
votes
1 answer
Python socketio with multiprocessing
So I have been struggling with this one error of pickle which is driving me crazy. I have the following master Engine class with the following code :
import eventlet
import socketio
import multiprocessing
from multiprocessing import Queue
from multi…
Aaditya Damani
- 313
- 2
- 10
2
votes
1 answer
Uncaught TypeError: Cannot read property 'sid' of undefined
I am using socket.io in a python-react app using the python-socketio and socket.io-client. The client is showing an error when it connects to the server and before triggering the connect event.
Server:
import asyncio
from aiohttp import web
import…
Gowtham
- 107
- 8
2
votes
1 answer
Stop a blocking python thread after timeout
I'm having an issue that is really difficult to find an already made solution for it.
I'm running a new python thread that is then blocked by a socket connection (python-socketio) because it is waiting indefinitely for data. But I need to close this…
Funeoz
- 21
- 1
2
votes
1 answer
flask-socketio emit from background task does't emit
Below is my code snippet, I'm running a background task and want to emit the id when the event is being called.
manage.py
from threading import Lock
continue_reading = True
thread = None
thread_lock = Lock()
socketio = SocketIO(app,…
Elad
- 426
- 1
- 8
- 19
2
votes
1 answer
Socketio installing problems
I'm facing a problem with socketio. I imported it into my programme by command:
import socketio
Wen I typped pip freeze I got:
python-socketio==4.5.1
Then I ran programme by typing into console:
myfile.py --mode "mode"
But it…
Natalie
- 23
- 3
2
votes
2 answers
python socket_io.emit() call from function
I am building a webserver application with aiohttp and python. For the exchange of data I'm using the socketio python implementation. For getting data from my frontend to my python script everything works as expected. Now I want to send some data…
Moritz Vierneusel
- 43
- 6
2
votes
1 answer
Secure communication between flask-socketio server and python-socketio
I am working on a project using flask-socketio and python-socketio. In order to secure the communication, the system needs to be upgraded with SSL. I am working with Mac and Python 3.7.
I created a certificate using openssl (rootCA.pem) and added…
Tyrion
- 175
- 1
- 13
2
votes
0 answers
High cpu usage on python socketio process with idle clients
When doing some tests with flask-socketio (on uwsgi with gevent) we noticed that when adding more clients, cpu usage on the socketio process quickly goes to 85%. The weird thing is that it doesn't seem to matter if the clients are in active…
Michielvv
- 306
- 2
- 12
2
votes
1 answer
How to use values sent from node.js server to python script client using python-socketio?
I use a node.js server to send data to python client.
Python's console display good receiving the data, but i can't find in documentation a way to use them in the Python's Client.
In Python's script console :
engineio.client - INFO - Received…
Jidé
- 45
- 4
2
votes
2 answers
Can't get multiple uwsgi workers to work with flask-socketio
In development, flask-socketio (4.1.0) with uwsgi is working nicely with just 1 worker and standard initialization.
Now I'm preparing for production and want to make it work with multiple workers.
I've done the following:
Added redis message_queue…
Michielvv
- 306
- 2
- 12
2
votes
1 answer
How catch socket.io exceptions in python
I am working on a class project and we are trying to catch a socket.io exception. Specifically, socketio.exceptions.ConnectionError: Connection refused by server
The purpose of us doing this is to keep attempting to connect if not connection has…
dsot
- 21
- 3
2
votes
1 answer
How to emit message from python server to javascript client in python-socketio?
The socketio client successfully connects to the server and sends messages with emit to the server but the other direction server to the client fails. I cannot find the source of error. It is
Here is the server python in app.py based on the example…
Mehdi
- 3,872
- 4
- 18
- 34