Closed CGenie closed 3 years ago
For future readers:
curl -X GET '<url>/socket.io/?transport=polling'
should return a Engine.IO handshake with a sid
field, that will be used in subsequent requests
curl -X GET '<url>/socket.io/?transport=polling&sid=<the sid>'
curl -X POST '<url>/socket.io/?transport=polling&sid=<the sid>" -d '11:42["hello",1]'
For an explanation of the encoding, please see here.
curl -X POST '<url>/socket.io/?transport=polling&sid=<the sid>" -d '1:2'
Please note that the requests must not overlap (you have to close an ongoing GET
request before sending a POST
request).
Hi,
My goal is to emit a single message to a socketio server, then quit. I use
polling
transport, so I do aGET
request to/socket.io?t=xxx&transport=polling
, this gives me back server response withsid
so I make anotherGET
to/socket.io?t=xxx&transport=polling&sid=xxx
which responsds with message�40
which, as I understand isengine.io
message (code 4), socket.io connect (code 0). Next when I repeat theGET
request withsid
,curl
waits for response, is this proper behaviour?When I do
POST
(withsid
etc) during that time in another terminal, the server sends engine.io1
message (close).How can I emit a message after the handshake?