import subprocessfrom flask import Flask render_template request jsonifyfrom flask_socketio import SocketIOapp = Flask__name__ template_folder=DpythonwebpingappconfigSECRET_KEY = secret_keysocketio =
The error message suggests that the client is using an unsupported version of the Socket.IO or Engine.IO protocols. To resolve this issue, you can try updating the versions of the Socket.IO and Engine.IO libraries in your project.
First, make sure you have the latest versions of Flask-SocketIO and Socket.IO installed. You can update them using the following command:
pip install -U flask-socketio python-socketio
If you are using an older version of Flask-SocketIO (prior to 5.0), you may need to update your code to use socketio.run(app, host='0.0.0.0', port=5000) instead of socketio.run(app).
If the issue persists, you can try downgrading the version of the Socket.IO client library used by the client-side code. You can find the client-side Socket.IO library version in the index.html file. Update the version to a compatible version, for example:
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.1/socket.io.js"></script>
Make sure the version you choose is compatible with the server-side version of Socket.IO.
Once you have made these changes, restart your Flask server and try running the program again
原文地址: http://www.cveoy.top/t/topic/iSEw 著作权归作者所有。请勿转载和采集!