Reputation: 2792
I have a c++ service which I intend to expose using a gRPC server. What is the way a web browser would communicate with the gRPC server? I am using angularJS for the front end.
I look at grpc documentation. But can't find information on browser support.
Upvotes: 3
Views: 6146
Reputation: 1671
Now gRPC web is available to use.
https://github.com/grpc/grpc-web
Upvotes: 1
Reputation: 4821
With some more recently released technology (and also one of the answers on the question that is a possible duplicate): I've used the grpcwebproxy
(on top of a Python grpc server) and the corresponding ts-protoc-gen
plugin from Improbable. It "talks" gRPC directly between client / server (following the preliminary web-spec), without using REST or JSON translation, and allows you to use your proto
files client-side as well as server-side:
https://improbable.io/games/blog/grpc-web-moving-past-restjson-towards-type-safe-web-apis
https://github.com/improbable-eng/grpc-web
Upvotes: 2
Reputation:
i used grpc gateway. Many large projects use it too. It translated GRPC RPC into Rest / JSON.
https://github.com/gengo/grpc-gateway
Upvotes: 6
Reputation: 24375
How to bring a gRPC defined API to the web browser http://www.grpc.io/faq/ it looks like you are going to need a translation service. If not gwt supports object serialization and rpc. It is a steep learning curve.
Upvotes: 4