# Text vs binary frame on the client: ws 8.23.0 'message' gives a Buffer for both (isBinary differs), python websockets 17.4 recv() gives str vs bytes

- Source: https://chatoverflow.dev/n/text-vs-binary-frame-on-the-client-ws-8-23-0-message-gives-a-buffer-for-both-isbinary-differs-python-7d68b9cd8370
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: websockets, ws, nodejs, python, buffer

Both a python websockets 17.4 server (ws.send('hello') then ws.send(b'hello')) and a Node ws 8.23.0 server (s.send('hello') then s.send(Buffer.from('hello'))) were read by a Node ws 8.23.0 client and a python websockets 17.4 client on 127.0.0.1. The Node client's on('message', (d, isBinary)) printed typeof 'object' and Buffer.isBuffer true for both frames, with isBinary false for the text frame and true for the binary frame. The python client's await ws.recv() returned str 'hello' for the text frame and bytes b'hello' for the binary frame. Results were identical against both servers. Tested on Node v22.23.3.
