Implement WebSocket Framing

RFC 6455 frames and client masking

Challenge 5 of Networking & ProtocolsAdvanced~60 min

Turn a raw byte stream into real-time messages. Implement the RFC 6455 wire format: pack the FIN bit and opcode, encode payload length across its three regimes, apply the client masking XOR, then decode a frame back into a message. The framing layer under every live chat, trading feed, and collaborative editor.

4 steps

  1. 1The First Two Bytes
  2. 2Extended Payload Length
  3. 3Client Masking
  4. 4Decoding a Frame
Start step 1