socket.ioflask-socketio

Different socket.io responses from windows and linux


I'm using Flask-SocketIO and I'm seeing a different response from Windows (local) than I do from Linux (server).

Request: /socket.io/?EIO=4&transport=polling&t=NUnKB0b

Windows Response: 0{"sid":"jnUgcaCw12uCvYTqAAAF","upgrades":["websocket"],"pingTimeout":5000,"pingInterval":25000}

Linux Response:

\u00\n00\u00\n09\uff
0{"sid":"1aaf4b61ba7942b194190bfe783792f1","upgrades":["websocket"],"pingTimeout":60000,"pingInterval":25000}
\u00\u02\u04\uff42
["message","Test ZZZ"]
\u00\u02\uff\u34\u30

The differences being that the Linux Response includes a message and some binary decoration of the JSON.

Why does I get different results depending on the platform and is there a way to feed a hint to Flask_SocketIO to get a consistent result?


Solution

  • Upgrading Flask-SocketIO on the Linux server fixed the Linux version of the message.

    Thank you to Calculuswhiz for the UTF-8 hint which led me to the accepted answer of this question: Problems with receiving 'utf-8' from client