binaryType

A string controlling how incoming binary messages are exposed on the message event. Can be nodebuffer, arraybuffer, or blob. The default is nodebuffer.

'nodebuffer' is an Electron extension that delivers binary messages as Buffer objects, which is generally the most convenient representation in the main process. Set binaryType to 'arraybuffer' or 'blob' for behavior identical to the renderer WebSocket.