ravindrab
ravindrab

Reputation: 2792

Web client communicate with gRPC server

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.

Image taken from https://dzone.com/articles/grpc-sample-in-c-and-python

Upvotes: 3

Views: 6146

Answers (4)

Abhishek Singh
Abhishek Singh

Reputation: 1671

Now gRPC web is available to use.

https://github.com/grpc/grpc-web

Upvotes: 1

user
user

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

user5571472
user5571472

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

Romain Hippeau
Romain Hippeau

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

Related Questions