From 0f391b2e2f69c7e9c437182b8196c1447e6fbbbd Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 3 Aug 2020 08:15:53 +0300 Subject: [PATCH] Update article.md --- 5-network/11-websocket/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/5-network/11-websocket/article.md b/5-network/11-websocket/article.md index b3a3b4b0..b374c2b7 100644 --- a/5-network/11-websocket/article.md +++ b/5-network/11-websocket/article.md @@ -177,12 +177,12 @@ A call `socket.send(body)` allows `body` in string or a binary format, including **When we receive the data, text always comes as string. And for binary data, we can choose between `Blob` and `ArrayBuffer` formats.** -That's set by `socket.bufferType` property, it's `"blob"` by default, so binary data comes as `Blob` objects. +That's set by `socket.binaryType` property, it's `"blob"` by default, so binary data comes as `Blob` objects. [Blob](info:blob) is a high-level binary object, it directly integrates with ``, `` and other tags, so that's a sane default. But for binary processing, to access individual data bytes, we can change it to `"arraybuffer"`: ```js -socket.bufferType = "arraybuffer"; +socket.binaryType = "arraybuffer"; socket.onmessage = (event) => { // event.data is either a string (if text) or arraybuffer (if binary) };