WebSocket frames, byte by byte

The browser's own WebSocket hides the wire format. This page uncovers it: compose a frame and watch the exact RFC 6455 bytes it becomes — opcode, length, masking key and all — using the same from-scratch codec the miniws server runs. Below, compute a real Sec-WebSocket-Accept from a client key.

Frame builder

—
header (FIN · opcode · MASK) payload length masking key payload

Handshake: Sec-WebSocket-Accept

sha1(key + GUID)— Sec-WebSocket-Accept—

The server appends the fixed GUID 258EAFA5-…-C5AB0DC85B11, takes the SHA-1, and base64-encodes it. The sample key above is the one from RFC 6455 §1.3 — the answer should be s3pPLMBiTxaQ9kYGzzhZRbK+xOo=.