I use Flask
and Flask-SocketIO
inside of a Python application.
Recently, when I start up the app, I am given this message:
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)
From my searching, I come to this table in Flask-SocketIO
s' docs, which suggests I have version incompatibilities in my system.
I would like to figure out which version of JavaScript Socket.IO I have. How can this be done?
System Details
If it's not obvious, I am new to JavaScript.
Flask 1.1.2
Flask-SocketIO 5.0.1
python-engineio 4.0.0
python-socketio 5.0.4
The conflict is probably from using different protocol revisions on the client and the server.
From socket.io Client API:
The protocol defines the format of the packets exchanged between the client and the server. Both the client and the server must use the same revision in order to understand each other.
To determine the revision number of the client,
From HTML:
<script src="<your-path-to>socket.io.js"></script>
<script>
const socket = io('http://localhost');
const revisionNumber = socket.protocol;
</script>
Or from JavaScript:
const io = require('socket.io-client');
// or with import syntax
import { io } from 'socket.io-client';
const revisionNumber = io.protocol;
Or from the Flask-SocketIO source code:
__version__
in the file __init__.py
. The line will look like this:__version__ = '5.0.2dev'
__version__
value, look up the corresponding Socket.IO protocol revision:+--------------+----------------+
| __version__ | protocol rev. |
+--------------+----------------+
| 4.x.x | 3, 4 |
+--------------+----------------+
| 5.x.x | 5 |
+--------------+----------------+