Workers - WebSocket binary messages now delivered as Blob by default
Key Points
- Binary frames delivered as Blob by default
- Set ws.binaryType = "arraybuffer" before accept() to opt back
- Use no_websocket_standard_binary_type in Wrangler to keep old default
Summary
Binary WebSocket frames received by Cloudflare Workers are now delivered to the message event as Blob objects by default, matching the WebSocket specification and browser behavior. Previously binary frames were always delivered as ArrayBuffer. This change is active for Workers with compatibility dates on or after 2026-03-17 (via the websocket_standard_binary_type compatibility flag). Durable Object hibernatable WebSocket handlers are unchanged and still receive ArrayBuffer.
Key Points
- Default delivery for binary frames is now
Blob(notArrayBuffer). - If your code assumes
event.datais anArrayBuffer,instanceof ArrayBufferchecks will fail and may silently drop frames. - To opt a single WebSocket back into ArrayBuffer delivery, set
ws.binaryType = "arraybuffer"before callingws.accept(). - To preserve the old ArrayBuffer default across a Worker, add the
no_websocket_standard_binary_typeflag to your Wrangler config. - The per-WebSocket
binaryTypeassignment works regardless of the compatibility flag.
Quick migration checklist
- Audit handlers that process
event.dataand avoid relying oninstanceof ArrayBuffer. - If you need ArrayBuffer for an individual connection, set
ws.binaryType = "arraybuffer"beforews.accept(). - If you need the old default globally, add
no_websocket_standard_binary_typeto Wrangler.
Resources
See the WebSockets binary messages documentation for details and examples.