Closed loelkes closed 1 year ago
The connection goes to a namespace called /client
. Is this correct? The most likely cause for the connection failure is that the server doesn't have this namespace.
That is correct. It's all there. The applications runs in production (Linux) and development (macOS) without issue. This error only appears on Windows (sometimes used for development). Other than the platform I can't spot any differences.
Sorry, I found it. I looked in all the wrong places, thanks for the fast response.
It turns out this was due to a misconfiguration of a module handling the connection in the client application. It was fixed but not updated on my Windows machine.
But it took me some time to find out what "Unable to connect" means. Maybe the log message could be more detailed there?
@loelkes What was the misconfiguration? What do you think the error message should say? Without these details I have no way to decide if I can provide a more appropriate error message.
The namespace I accessed did not exist. In my application namespaces are created on demand or depending on the configuration of the system so I'm not aware of how they're called and I missed this.
Maybe the message could be something like "Unable to connect, Namespace does not exist"? Do you want me to open a PR for this?
Description
My Flask application runs without issues on Linux and macOS hosts, either with
FLASK_DEBUG=True flask run
(for development) or inside a Docker container with uWSGI (for production). On my Windows 10 (19045.2913) the client (Browser) receives an "Unable to connect" error. The code is the same for all platforms, Python 3.11.3.I don't know where to look any further. Is this an issue or am I using it wrong?
Log
This seems to come from here:
https://github.com/miguelgrinberg/python-socketio/blob/270eb372cc83778a897d32e95453eb385328d9de/src/socketio/server.py#L658-L669
Flask application
uWSGI command
wsgi.py
Versions