Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer is not supported when it's a field in an JS object? #373

Open
HuakunShen opened this issue Nov 6, 2023 · 2 comments
Open

Buffer is not supported when it's a field in an JS object? #373

HuakunShen opened this issue Nov 6, 2023 · 2 comments

Comments

@HuakunShen
Copy link

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.

@HuakunShen
Copy link
Author

I realized that it can be partially captured by on_any
image

But instead of getting the entire JS object, I could only get the binary part.

@HuakunShen
Copy link
Author

In Postman, this is what's received
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant