python socketio - 服务器未返回打开的数据包

1 django node.js socket.io

我正在尝试连接到套接字服务器(node.js),例如http://localhost:4300。服务器端已经连接成功,

在我的服务器日志上

客户端已连接 {client_id}

但在我的客户端(python-socketio 客户端)它返回异常

服务器未返回 OPEN 数据包

谁能帮我解释一下为什么我会得到这个例外?我一直在按照文档所说的去做。

小智 9

这可能表明服务器和客户端版本不兼容。对我有用的是固定 python-engineio 和 python-socketio 的包版本:

pip install python-engineio==3.14.2 python-socketio==4.6.0
Run Code Online (Sandbox Code Playgroud)

(来源:https ://github.com/miguelgrinberg/python-socketio/issues/586 )

关于版本兼容性另请参阅https://python-socketio.readthedocs.io/en/latest/intro.html