我试图在 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 没有任何错误