WIRE LAB · ENCODE · PARSE · INSPECT
WebSocket frames: inspect masking and message assembly
Encode text into WebSocket frames, split the wire bytes and inspect fragmentation, masking, ping and rejection behavior.
Delivered application output
Exact byte and parser state
Decode bytes instead of moving labels
The editable text is encoded as UTF-8, split into message fragments and wrapped in actual bounded WebSocket frame headers. The first text frame uses opcode one; later fragments use continuation opcode zero. FIN marks the final fragment. Network chunks then split those wire bytes independently of frame boundaries. The parser waits for complete headers and payloads, unmasks payload bytes when required and assembles the text message before validating UTF-8. A split emoji therefore remains a single character in a valid completed message. Hexadecimal bytes and decoded frame records make each transformation inspectable.
Control framing and failure cases
Message text is limited to one thousand characters. Sender chooses client-to-server or server-to-client direction: client frames are masked and server frames are not. Payload bytes per fragment ranges from one to sixty-four; zero puts the whole message in one frame and can exercise the sixteen-bit extended-length header. Network chunk bytes changes how much wire data reaches the parser at once. Insert ping adds a small control frame after the first data frame. If that data frame is not final, the ping occurs inside the fragmented message. Fault injection selects a wrong mask flag, an orphan continuation, a missing final FIN or malformed UTF-8. Fault cases intentionally violate the selected rule.
Watch assembly and rejection
Restore defaults and set both fragment and network chunk size to one byte. Seek to the end: the complete text, including the emoji, should appear exactly once. The ping record produces a prepared pong payload without becoming message text. Select wrong mask flag and observe rejection rather than successful decoding. Select missing final FIN: the parser retains an unfinished message but emits no text. This remains incomplete even when the message is empty. Use a long message with fragment size zero to inspect the extended payload length. Switching sender direction changes the mask bit and wire payload while preserving the decoded valid text.
Inspect safely and understand the boundaries
Play maps the byte sequence to sixty inspection seconds. Pause freezes it; Next chunk advances one parser step; Restart rewinds; Speed changes viewing pace; Inspect time scrubs the trace. Restore defaults resets every input. Results use literal text rendering, so pasted markup is not executed. The deterministic four-byte masking keys make XOR operations reproducible, but real clients require unpredictable fresh keys; this generator is not a secure networking implementation. The parser supports only bounded text, continuation and ping frames, with payloads up to 4096 bytes. It does not implement handshakes, TLS, binary messages, close negotiation, compression extensions, sixty-four-bit lengths or actual pong transmission. Ping replies shown here are prepared payloads, not messages sent over a socket. No external endpoint is contacted.