Skip to content

Help to port Socket.IO to Emscripten (WebAssembly) #5251

Answered by darrachequesne
skhaz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

The protocol is split in two:

  • the Engine.IO protocol
    • 0{"sid":"w4Nlz...} is the handshake sent by the server
    • 2 are indeed PING packets, and the client should respond with a PONG packet (3)

Reference: https://socket.io/docs/v4/engine-io-protocol/

  • the Socket.IO protocol

Every Socket.IO packet must be prefixed by 4, indicating an Engine.IO MESSAGE packet.

So sending a CONNECT packet (0) becomes a 40 over the wire.

Then you will be able to send message with 42[...].

Reference: https://socket.io/docs/v4/socket-io-protocol/#format

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by darrachequesne
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants