opcode
A small number in a frame header saying what kind of frame it is, such as text, binary, ping, pong or close.
In more detail
In WebSocket the first byte 0x81 means final fragment plus opcode 1, a text frame. Opcodes 8, 9 and 10 are the control frames close, ping and pong.
Related terms
- frame — A self-contained unit of data in a protocol such as HTTP/2 or WebSocket, with a small header giving its type and length.
- WebSocket — A protocol that turns an HTTP connection into a long-lived, two-way channel where client and server can each send messages at any time.
Taught in
- Native WebSockets: Bidirectional Real-Time Streams — Node.js Internals & Backend Services