Open titanism opened 5 days ago
Are you are setting websocket.binaryType
to 'blob'
?
Please share a minimal test case to reproduce the issue. I am unable to do it with the provided info. The following example works as expected.
import { WebSocket, WebSocketServer } from 'ws';
import { pack, unpack } from 'msgpackr';
const wss = new WebSocketServer({ port: 0 }, function () {
const { port } = wss.address();
const ws = new WebSocket(`ws://127.0.0.1:${port}`);
ws.on('open', function () {
ws.send(pack('Hello'));
});
ws.on('message', function (buf) {
console.log(unpack(buf));
ws.close();
});
});
wss.on('connection', function (ws) {
ws.on('message', function (buf) {
ws.send(pack(unpack(buf)));
});
ws.on('close', function () {
wss.close();
});
});
@titanism are you are setting websocket.binaryType to 'blob'? Let's continue the discussion in https://github.com/websockets/ws/issues/2239.
No, not at the moment. All we did was upgrade to latest version of ws
and this issue came about.
Maybe it was already set. It was simply ignored before. I can't help without a test case.
Is there an existing issue for this?
Description
See comment here https://github.com/websockets/ws/pull/2229#issuecomment-2207912046
ws version
8.18.0
Node.js Version
latest
System
No response
Expected result
No response
Actual result
No response
Attachments
No response