-
-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocket Server Breaks After Installing gevent-websocket #2122
Comments
gevent-websocket was released last in 2017. Why do you need it? |
I need both WebSockets and Socketio, I don't specifically need gevent-websocket, I just happen to be using gevent. I'll just ignore the warning and move on. The warning tripped me up though, since I installed gevent-websocket long before running into this issue, and it took me a while to realise that it wasn't client side. Presumably the warning isn't coming from flask-sock? |
In the current version of Flask-SocketIO the gevent-websocket package is not required, in fact, it is best not to use it since it is unmaintained and has been for many years. I now realize that there is a warning in this package that is outdated. I'll remove it. WebSocket works fine without gevent-websocket in current versions, the Also, you referenced Flask-Sock and initially wrote this issue on that project, but Flask-Sock has no connection to Flask-SocketIO. None at all, they are different solution, both use WebSocket, but that is as far as the connection goes. |
The warning has been removed, since it does not apply anymore. |
I am encountering an issue where the WebSocket server functions correctly without
gevent-websocket
installed, but breaks once the library is added.gevent-websocket
: WebSocket connections to ws://127.0.0.1:5001/ws work as expected. I can successfully connect using:However, the following warning appears in the server console:
WARNING in __init__: WebSocket transport not available. Install gevent-websocket for improved performance.
gevent-websocket
installed: The server accepts WebSocket connections but immediately closes them. I see a101 Switching Protocols
response in the network logs, followed by errors and a closed connection on the client side. The server does not report any anomaliesHere is the code in question. It's a minimal Flask app using both flask-sock and Flask-SocketIO, with gevent:
The above works with gevent-websocket if I remove socketio.
Here's the result of my pip freeze. These are all the latest versions I can install. I'm using python 3.12.8.
The text was updated successfully, but these errors were encountered: