WebSocket binary messages now delivered as Blob by default
Key Points
- Binary WebSocket messages now default to Blob instead of ArrayBuffer
- Set binaryType property before accept() to opt back into ArrayBuffer
- Add compatibility flag to Wrangler config to preserve ArrayBuffer behavior
Summary
Cloudflare Workers now delivers binary frames received on WebSocket connections as Blob objects by default, matching the WebSocket specification and standard browser behavior. Previously, binary frames were always delivered as ArrayBuffer.
Key Points
- Binary frames are now delivered as Blob objects instead of ArrayBuffer for Workers with compatibility dates on or after 2026-03-17
- The change is controlled by the
websocket_standard_binary_typecompatibility flag - Use the
binaryTypeproperty on WebSocket to control delivery type per-WebSocket basis - To opt back into ArrayBuffer delivery, set
ws.binaryType = "arraybuffer"before callingaccept() - To keep ArrayBuffer as default for all WebSockets, add
no_websocket_standard_binary_typeflag to Wrangler configuration - Durable Object hibernatable WebSocket
webSocketMessagehandler continues to receive binary data as ArrayBuffer - Code that assumes
event.datais an ArrayBuffer may silently drop frames without proper type checking