Read from the socket can return:
Content-Length for HTTP requests| Frame | FIN | Opcode | Payload |
|---|---|---|---|
| 1 | 0 | 0001 (text) | "Never look " |
| 2 | 1 | 1010 (pong) | |
| 3 | 0 | 0000 (continuation) | "directly into " |
| 4 | 1 | 0000 (continuation) | "the sun" |
| Frame | FIN | Payload Length | Total Bytes |
|---|---|---|---|
| 1 | 1 | 1500 | 1508 |
| 2 | 1 | 2000 | 2008 |
conn.Read(buffer) with a 2048 byte buffer
conn.Read(buffer) with a 2048 byte buffer returns:
make([]byte, payloadLength) from an untrusted lengthnet.Dial("tcp", "localhost:8080"), send a handshake, read the 101Write (back-to-back)Writes with a time.Sleep between them (split header)00 00 00 00