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

How to use socket.io with Protobuf ? #302

Open
ouroboros17 opened this issue Mar 3, 2024 · 1 comment
Open

How to use socket.io with Protobuf ? #302

ouroboros17 opened this issue Mar 3, 2024 · 1 comment

Comments

@ouroboros17
Copy link

Hello, I have been using your library for websockets for a while now and now I have a need to pass binary data to Protobuf, how to implement this?

@Awesome-T
Copy link

Awesome-T commented Mar 5, 2024

Hello, I have been using your library for websockets for a while now and now I have a need to pass binary data to Protobuf, how to implement this?

Hi there! Of course, you can send binary data using various methods, such as WebSockets, REST, and so on. For example, take a look at the WebSockets method, which takes either a byte or a string argument. You will need to call this method from your DT model, which is created by the Protocol Utility's writeToBuffer(). After that, you will want to add this array to your WebSocket send method.

[https://pub.dev/documentation/protobuf/latest/protobuf/GeneratedMessage/writeToBuffer.html

https://api.flutter.dev/flutter/dart-io/WebSocket/add.html

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

2 participants