WebSocket Frames: Opcodes, Masking & Close Codes
Below the handshake lies the WebSocket wire format (RFC 6455): the frame header, opcodes, mandatory client masking and why it exists, payload-length encoding, fragmentation, control frames, and close codes. The masking and length facts here are verified in Node.
Questions
- Not answered. A WebSocket frame's first byte is
0x81. What does that tell you? - Not answered. Which opcode identifies a binary data frame? Give it as a decimal number.
- Not answered. Which statements about WebSocket frame masking are correct?
- Not answered. What problem does mandatory client→server masking actually solve?
- Not answered. A frame's 7-bit payload-length field holds the value
126. What does that mean? - Not answered. Name the control frame (opcode
0x8) that initiates the WebSocket closing handshake. - Not answered. Which rules apply to WebSocket control frames (Close, Ping, Pong)?
- Not answered. What WebSocket close status code signals a normal closure?
- Not answered. Your client logs WebSocket close code
1006, but the server insists it never sent it. Why? - Not answered. A message is sent as several fragments. What opcode do the 2nd and later frames carry?
- Not answered. Must a
textframe's payload be valid UTF-8, and what happens if it isn't?