Oscar Tong
Everything that has a beginning has an end.
GET /secret.html HTTP/1.1
Host: www.example.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
...
> GET /index.html HTTP/1.1
> Host: www.example.org
< HTTP/1.1 200 OK
< Content-Type: text/html
< Set-Cookie: name=value
< Set-Cookie: name2=value2; Expires=Wed, 09 Jun 2021 12:34:56 GMT
> GET /spec.html HTTP/1.1
> Host: www.example.org
> Cookie: name=value; name2=value2
GET /chat HTTP/1.1
Host: www.example.com
Origin: http://www.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat
GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
Sec-WebSocket-Accept = base64( sha1( Sec-WebSocketKey + GUID ));
0 1 2 3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-------+-+-------------+------------------------------+ |F|R|R|R| Opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16 or 64) | |N|V|V|V| |S| | (if payload len == 126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+------------------------------+ | Extended payload length continued, if payload len == 127 | +-------------------------------+------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+------------------------------+ | Masking-key continued | Payload Data | +-------------------------------+------------------------------+ : Payload Data continued ... : +--------------------------------------------------------------+ | Payload Data continued ... | +--------------------------------------------------------------+
By Oscar Tong