Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The client is using an unsupported version of the Socket.IO or Engine.IO protocols Error

I'm trying to run a client an server in python using flask_socketio, socketIO_client and SOCKET.IO in a raspberry pi 4 but I'm getting the following error:

The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
192.168.1.80 - - [05/Feb/2021 18:30:41] "GET /socket.io/?EIO=3&transport=polling&t=NTpTT-L HTTP/1.1" 400 219 0.000618

These are my current versions:

pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io EDAdataLogger@ /home/pi/Desktop/EDAdataLogger └── [email protected]

pi@raspberrypi:~/Desktop/EDAdataLogger $ npm list socket.io-client EDAdataLogger@ /home/pi/Desktop/EDAdataLogger └── [email protected]

python-engineio==4.0.0
python-socketio==5.0.4
Flask==1.1.2
Flask-Session==0.3.2
Flask-SocketIO==5.0.1

How can I define JavaScript Socket.IO version and Socket.IO protocol revision so everything matches according to (https://pypi.org/project/python-socketio/) ?

How can I fix this? Thank you

like image 470
Ptb Avatar asked Feb 05 '21 19:02

Ptb


5 Answers

There appears to be some backward compatibility issues with SocketIO. You can uninstall python-engineio, python-socketio (and Flask-SocketIO just to be on the safe side) and reinstall lower versions.

The combination that worked for me was:

Flask-SocketIO==4.3.1
python-engineio==3.13.2
python-socketio==4.6.0
like image 180
Joel Oduro-Afriyie Avatar answered Oct 01 '22 08:10

Joel Oduro-Afriyie


To fix the version incompatibility, you can run below "upgrade"commands:

pip install --upgrade python-socketio==4.6.0

pip install --upgrade python-engineio==3.13.2

pip install --upgrade Flask-SocketIO==4.3.1
like image 38
Ravi Pullagurla Avatar answered Oct 01 '22 07:10

Ravi Pullagurla


flask-socketio-5.1.2 python-engineio-4.3.2 python-socketio-5.6.0

script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.0/socket.io.js">

This worked for me. This error is due to dependency related to python-engineio . After this, check your socket request shows EIO4 like this "GET /socket.io/?EIO=4&transport=websocket&sid=mJ1g8wm0didssJSiAAAA HTTP/1.1" 200

like image 43
Neelam Jhuria Avatar answered Oct 01 '22 07:10

Neelam Jhuria


My fix was to use the socket.io version, not cloudflare as the source

like image 20
Ryder R Avatar answered Oct 01 '22 09:10

Ryder R


Check for the compatibility between the JS Client version and the Socket.IO server version here: https://socket.io/docs/v4/client-installation/ and accordingly upgrade/downgrade the client/server version.

You will need these modules on the server side:
Flask-SocketIO
python-engineio
python-socketio

You will have this kind of URL in your client: //cdnjs.cloudflare.com/ajax/libs/socket.io/

One working example, which I'm using:

On Server side:
Flask-SocketIO==5.2.0
python-engineio==4.3.3
python-socketio==5.7.1
simple-websocket==0.7.0

On Client side:
//cdnjs.cloudflare.com/ajax/libs/socket.io/4.2.0/socket.io.js

like image 36
Khushhalm Avatar answered Oct 01 '22 08:10

Khushhalm