grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.51k stars 766 forks source link

C++ gRPC-web client ? #1248

Closed NikolaiBirolini closed 4 months ago

NikolaiBirolini commented 2 years ago

Hello everyone !

I want to use gRPC-web to print a login page. So I tested the echotest example and all the other examples, but I remarked that all the examples have this architecture :

web browser <-> gRPC javascript client <-> proxy <-> gRPC Backend server (C++, pthon, go ...)

Is it possible to replace this javascript client by a C++ client ?

If it's the case, can you advice me some examples ?

Thank you for your help,

sampajano commented 2 years ago

hi!

do you mean you want this instead?

A) web browser <-> c++ client <-> proxy <-> gRPC Backend server (C++, pthon, go ...)

Or this?

B) c++ client <-> proxy <-> gRPC Backend server (C++, pthon, go ...)

For A, i don't really know what that means..

For B, i think you can probably skip the proxy entirely and use the grpc c++ client? like this?

C) c++ client <-> gRPC Backend server (C++, pthon, go ...)

In any case, unless you use the javascript client it's outside of the scope of the grpc-web client since this project is web (browser) focused :)

Not sure if that makes sense.. :)

grefab commented 4 months ago

I think what @NikolaiBirolini meant was a c++ implementation of a grpc-web client. I'm looking for that as well. I have a c++ program that is built as wasm using emscripten and runs in the browser. Hence it can only speak HTTPS to the outside and not plain grpc. For go, I successfully used https://github.com/ktr0731/grpc-web-go-client. Any suggestions for c++?

NikolaiBirolini commented 4 months ago

Hey ! Yes, you're right but I found a solution for my project. To interface my web client with my gRPC server, I used envoy proxy

Le jeu. 4 avr. 2024, 23:40, Gregor Fabritius @.***> a écrit :

I think what @NikolaiBirolini https://github.com/NikolaiBirolini meant was a c++ implementation of a grpc-web client. I'm looking for that as well. I have a c++ program that is built as wasm using emscripten and runs in the browser. Hence it can only speak HTTPS to the outside and not plain grpc. For go, I successfully used https://github.com/ktr0731/grpc-web-go-client. Any suggestions for c++?

— Reply to this email directly, view it on GitHub https://github.com/grpc/grpc-web/issues/1248#issuecomment-2038278569, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6BLSLNYNBMOU5N3LFDTDLY3XCE3AVCNFSM5XEKZZFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBTHAZDOOBVGY4Q . You are receiving this because you were mentioned.Message ID: @.***>

sampajano commented 4 months ago

@grefab Thanks for sharing your understandings! Yeah i'm not quite aware of a C++ implementation of grpc-web. Maybe you could make your wasm library talk to our library using WebAssembly JavaScript API? Other I'm not quite aware of other solutions at the moment maybe you could look around some more :)


@NikolaiBirolini Glad that you have a solution now! I'll close this issue for now in that case. :)

grefab commented 3 months ago

Thanks for the update! for now I am just using http put/get and that's enough at the moment.