将 Python socketIO_client 与 Nodejs Socket.io 服务器连接

时间:2021-02-15 13:04:12

标签: python node.js websocket socket.io

我试图在 python 上监听从 NodeJS socket.io 在微粒房间广播的消息,我用来连接的脚本是:

from socketIO_client import SocketIO

try:
    socketIO = SocketIO('192.168.1.114',3000 , transports=['websocket'])
    socketIO.emit("test_room", 'testing msg')
    print(socketIO)
except Exception as e:
    print(e)

print("Connected")

它与服务器连接,我可以在服务器控制台上看到有人已连接但它没有在服务器上接收任何消息或广播任何内容并打印 Connected 没有任何错误

0 个答案:

没有答案