Code which was working on socketio version 4.6.0 is not working now in version 5.0.4 #718
Replies: 10 comments
-
Did you upgrade your server? The new Socket.IO protocol version is not backwards compatible, if you upgrade the client you have to upgrade the server too. |
Beta Was this translation helpful? Give feedback.
-
No, server is not in my control. I only do client side code. |
Beta Was this translation helpful? Give feedback.
-
Can you please give me more information about the Socket.IO protocol versions and which version of the library supports which one? So that I can update the library appropriately. |
Beta Was this translation helpful? Give feedback.
-
https://python-socketio.readthedocs.io/en/latest/intro.html#version-compatibility |
Beta Was this translation helpful? Give feedback.
-
Thank you for the information. How do I find out which version the server is using? Is there any way? |
Beta Was this translation helpful? Give feedback.
-
There are two major variations of Socket.IO currently in use. The new one, represented by the Socket.IO v3 JavaScript reference client and server, and the old one, which is based on the v2 Socket.IO JavaScript. The v5 of this package maps to the v3 of Socket.IO. If that does not work, then try v4. When you switch versions make sure you also install the correct version of python-engineio. The table shows the correct versions for each. |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg I also upgraded gtom 4.6.1 to 5.0.4 and get a very similar namespace error. In my case, the initial connection to the "/" namespace seems to work:
but the first attempt to send a message via socket io results in the error:
A full log is appended below. FWIW, at the moment I have both v2 and v3 installed and listening on the server side and distinguish them by using a different socketio_path for v3 from the default (see below). Perhaps use of a non-standard socketio_path might be relevant?
|
Beta Was this translation helpful? Give feedback.
-
@ericmandel See #634 |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg Beautiful, thanks! All is well now ... |
Beta Was this translation helpful? Give feedback.
-
pythons-socketio version 4.6.0 & engineio version 3.13.1
Connects and works perfectly withtout any problem.
Note:
Namespace / is connected
and no rejection from server sideVersion information of socketio & engineio
logging enabled in both library
Uninstalled both and installed latest version of both.
python-socketio = 5.0.4
python-engineio = 4.0.0
Latest library connects, but server sending
namespace / was rejected message
, eventually leading to BadNamespaceError \ errorpython-socketio = 5.0.4
python-engineio = 4.0.0
In both client code is same, server is same only difference is socketio and enginio libraries.
Please let me know what I'm doing wrong or how to tackle this.
Beta Was this translation helpful? Give feedback.
All reactions