Replies: 2 comments 3 replies
-
Above is attached debug logs, "test" event is plaintext JSON and "log_event" was serialized as binary (but the engine received trimmed plaintext??). Very weird |
Beta Was this translation helpful? Give feedback.
1 reply
-
I think I found the culprit! We expect an this.socket.on("message", (data, isBinary) => {
const message = isBinary ? data : data.toString();
debug('received "%s"', message);
super.onData(message);
}); If we take the following code: import WebSocket, { WebSocketServer } from 'ws';
const wss = new WebSocketServer({
port: 3000
});
wss.on('connection', ws => {
ws.on('message', (data, isBinary) => {
console.log('received', data, isBinary);
});
});
const ws = new WebSocket('ws://www.localhost:3000');
ws.on('open', function open() {
ws.send('hello');
ws.send(Buffer.from([1, 2, 3]));
}); Output with Node.js:
Output with bun:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is anyone else successfully transmitting BINARY messages with socket.io using the Bun runtime? I've spent hours debugging and I seriously think it's an issue with Bun at this point given the code was working with npm.
Beta Was this translation helpful? Give feedback.
All reactions