drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.62k stars 1.12k forks source link

Protobuf supported? #1248

Closed aabolfazl closed 6 months ago

aabolfazl commented 2 years ago

Does the dragon support Google Protobuf? I could not find anything in the code. Can we work on it?

an-tao commented 2 years ago

Drogon doesn't support protobuf specially, you could implement this part yourself, particularly, you can implement the fromRequest (or toResponse, etc.) template like:

template <MessageType>
std::shared_ptr<MessageType> fromRequest(const HttpRequest &req);
MuriloChianfa commented 2 years ago

i am implemented protobuf in websocket mode, and it seems simple to use:

image

using on web:

image

web output:

image

logs of drogon:

image

I'm finding it cool and really enjoying the performance.