rust-socketio
rust-socketio copied to clipboard
Buffer is not supported when it's a field in an JS object?
I was sending this kind of event, where one field is Buffer.
socket.emit("echo" {
value: Buffer.from(uuidv4()),
uuid: uuidv4(),
createdAt: new Date(),
});
It doesn't seem to work with rust-socketio. When I use string for value
I can receive events and payload.
But when I send buffer in field value it doesn't work. rust-socketio doesn't show anything, no payload received and no error.
JavaScript SocketIO supports this, I am wondering if this is supported by rust-socketio (I know pure Bytes is supported).
A solution could be serialize buffer into base64 string, but this will cost extra time and resource.
I realized that it can be partially captured by on_any
But instead of getting the entire JS object, I could only get the binary part.
In Postman, this is what's received