Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket.IO framing protocol, I do not understand. #11

Closed
mudlee opened this issue Nov 25, 2014 · 4 comments
Closed

Socket.IO framing protocol, I do not understand. #11

mudlee opened this issue Nov 25, 2014 · 4 comments

Comments

@mudlee
Copy link

mudlee commented Nov 25, 2014

I use socket.io with xhr-polling. I have to manipulate the content, but I cannot understand one part of the protocol.
If I send a broadcast message (event), I see that the message starts with 42. 4 means it's an event, 2 means it's a message (engine.io).
But, if I use xhr-polling, instead of websocket, I see some unicode characters at the start of the packet, such as: \u0000\u0003\u0002\u0004�42[...PACKET...]

What do these unicode characters mean? What is that question before 42? I don't see any related documentations, but I do see that the message when it's an xhr-polling transport is binary encoded. BUT, how, and in what structure?
I tried to figure out with this: http://unicode-table.com/en/
But I've not found any good answer :(

@thetrompf
Copy link

The 4 part comes from the engine.io-protocol (abstract transport layer) which means message and the 2 part comes from the socket.io-protocol (specific transport layer) which is the message type and means event, internally referenced as MESSAGE_EVENT.

@rauchg
Copy link
Contributor

rauchg commented Nov 30, 2015

I'm closing this in favor of #14, let's continue the discussion there.

@rauchg rauchg closed this as completed Nov 30, 2015
@tamj0rd2
Copy link

tamj0rd2 commented Jul 2, 2018

So can the 42 be ignored?

@thetrompf
Copy link

What do you mean ignored? It's part of the protocol. It is not a part of your data, if that's what you mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants