I\'m trying to get a Python client talking to a Node.js server using Socket.io 0.7, by sending a custom event to the server.
Based on the Socket.io reference I have
Resolved. I needed to use double quotes. Single quotes are not valid JSON. Woops.
ws.send("5:1::{'name':'newimg', 'args':'bla'}")
Becomes:
ws.send('5:1::{"name":"newimg", "args":"bla"}')
I wrapped rod's research into a barebones socket.io client library.
pip install -U socketIO-client
python
from socketIO_client import SocketIO
with SocketIO('localhost', 8000) as socketIO:
socketIO.emit('aaa')
socketIO.wait(seconds=1)