Decode message sent from server when connecting #925
-
First of all, I'm very new at this, so I apologize beforehand if this is a dumb question. I'm trying to build a client on python, which mimics the function of this page (relevant code at lines 1192-1260 of source). When connecting to the endpoint with:
I get:
From the webpage I linked above, I can assume that the server sent something that is compressed with gzip and encoded in base64. I guess that is the reason I'm getting the above error. Despite the error, it connected successfully, and the main function can work without problems with:
So my question is, how do I write the function so that the message sent from the server when I connect be decoded and decompressed with base64 and gzip? And also, when diconnecting with
I suspect unexpected error is also because the message is encoded and compressed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Not sure if this is the only problem, but the page you linked uses an old version of Socket.IO that is incompatible with the current one. You may want to try downgrading your Python client to the latest 4.x release. See version compatibility for details. This server you are connecting to is using the Engine.IO protocol version 3. You can see the |
Beta Was this translation helpful? Give feedback.
-
Hi @imjuzcy I'm trying to work with the MyRapid Bus Kiosk API as well. Have you manage to get it working with your apps? Was searching through GitHub on if anyone had worked on it before. Would love to connect with you and apologise that this might not be the best place to communicate. You can reach me at [email protected] |
Beta Was this translation helpful? Give feedback.
Not sure if this is the only problem, but the page you linked uses an old version of Socket.IO that is incompatible with the current one. You may want to try downgrading your Python client to the latest 4.x release. See version compatibility for details. This server you are connecting to is using the Engine.IO protocol version 3. You can see the
EIO=3
in the connection URL that it uses. The Python client is sendingEIO=4
.