⚠️
Maintenance. Notice: the site is currently in maintenance mode, so the amount of available material is temporarily limited.
The vocabulary of real-time JavaScript and the WebSocket protocol, in plain language. Terms link out to the guide that covers them in depth.
Словарь real-time JavaScript и протокола WebSocket простым языком. Термины ведут к руководству, где тема разобрана подробно.
| Term | Definition |
|---|---|
| ArrayBuffer | A fixed-length raw binary buffer. Set binaryType = "arraybuffer" to receive binary frames as one. See binary data. |
| Backoff | Increasing the wait between retries (often exponentially) to avoid hammering a server. See reconnection. |
| Backpressure | The signal that a consumer can't keep up with a producer. Monitor bufferedAmount and slow down when it grows. |
| Backplane | A shared pub/sub channel (e.g. Redis) that relays messages between server nodes. See scaling. |
| bufferedAmount | Bytes queued by send() but not yet written to the network — your backpressure gauge. |
| Close code | A numeric reason sent when a connection closes (e.g. 1000 normal, 1012 restart). See the reference. |
| Context takeover | Keeping the DEFLATE dictionary between messages for better compression at a memory cost. See compression. |
| DEFLATE | The compression algorithm behind gzip and permessage-deflate. |
| Duplex (full) | Both peers can send at the same time — the defining property of WebSocket vs request/response HTTP. |
| EventSource | The browser API for Server-Sent Events; one-way and auto-reconnecting. |
| Frame | The protocol's unit of data. A message is one or more frames; control frames carry ping/pong/close. |
| Handshake | The HTTP Upgrade exchange that turns a request into a WebSocket. See basics. |
| Heartbeat | Periodic ping/pong (or app-level) traffic that detects dead sockets and keeps proxies alive. See heartbeats. |
| Long polling | A fallback where the client holds an HTTP request open until data is ready, then re-requests. |
| Masking | Client-to-server frames are XOR-masked with a random key, a protocol requirement that mitigates proxy cache poisoning. |
| Opcode | A 4-bit code identifying a frame's type (text, binary, ping…). See the reference. |
| permessage-deflate | The standard extension (RFC 7692) that compresses each message. See compression. |
| Ping / Pong | Control frames (0x9/0xA) used for keep-alive; browsers auto-reply to pings. |
| readyState | A socket's lifecycle: 0 connecting, 1 open, 2 closing, 3 closed. |
| RFC 6455 | The specification that defines the WebSocket protocol. |
| Sticky session | Load-balancer affinity pinning a client to the node that holds its connection. See scaling. |
| Subprotocol | An application protocol negotiated via Sec-WebSocket-Protocol during the handshake. |
| Ticket | A short-lived, single-use token passed at connect time to authenticate. See authentication. |
| Upgrade | The HTTP header/mechanism that switches a connection's protocol to WebSocket. |
| wss:// | WebSocket over TLS — the secure scheme you should always use in production. |
| Термин | Определение |
|---|---|
| ArrayBuffer | Бинарный буфер фиксированной длины. Задайте binaryType = "arraybuffer", чтобы получать бинарные кадры в таком виде. См. бинарные данные. |
| Backoff | Увеличение паузы между повторами (часто экспоненциально), чтобы не «бомбить» сервер. См. переподключение. |
| Backpressure | Сигнал, что потребитель не успевает за производителем. Следите за bufferedAmount и замедляйтесь при росте. |
| Backplane (шина) | Общий pub/sub-канал (напр. Redis), переносящий сообщения между узлами. См. масштабирование. |
| bufferedAmount | Байты, поставленные send() в очередь, но ещё не отправленные — индикатор backpressure. |
| Код закрытия | Числовая причина закрытия соединения (напр. 1000 норм., 1012 рестарт). См. справочник. |
| Context takeover | Сохранение словаря DEFLATE между сообщениями ради сжатия ценой памяти. См. сжатие. |
| DEFLATE | Алгоритм сжатия, лежащий в основе gzip и permessage-deflate. |
| Дуплекс (полный) | Обе стороны могут слать одновременно — определяющее свойство WebSocket против HTTP «запрос/ответ». |
| EventSource | Браузерный API для Server-Sent Events; односторонний и авто-переподключающийся. |
| Кадр (frame) | Единица данных протокола. Сообщение — один или несколько кадров; управляющие кадры несут ping/pong/close. |
| Рукопожатие | Обмен HTTP Upgrade, превращающий запрос в WebSocket. См. основы. |
| Heartbeat | Периодический ping/pong (или на уровне приложения) для обнаружения мёртвых сокетов и удержания прокси. См. heartbeat. |
| Long polling | Фолбэк, где клиент держит HTTP-запрос открытым до появления данных, затем запрашивает снова. |
| Masking (маскирование) | Кадры клиент→сервер XOR-маскируются случайным ключом — требование протокола против отравления кэша прокси. |
| Опкод | 4-битный код типа кадра (текст, бинарный, ping…). См. справочник. |
| permessage-deflate | Стандартное расширение (RFC 7692), сжимающее каждое сообщение. См. сжатие. |
| Ping / Pong | Управляющие кадры (0x9/0xA) для keep-alive; браузеры авто-отвечают на ping. |
| readyState | Жизненный цикл сокета: 0 connecting, 1 open, 2 closing, 3 closed. |
| RFC 6455 | Спецификация, определяющая протокол WebSocket. |
| Sticky-сессия | Привязка балансировщика, закрепляющая клиента за узлом с его соединением. См. масштабирование. |
| Субпротокол | Прикладной протокол, согласуемый через Sec-WebSocket-Protocol при рукопожатии. |
| Тикет | Короткоживущий одноразовый токен, передаваемый при подключении для аутентификации. См. аутентификацию. |
| Upgrade | HTTP-заголовок/механизм, переключающий протокол соединения на WebSocket. |
| wss:// | WebSocket поверх TLS — безопасная схема, которую всегда стоит использовать в продакшене. |