15

I could successfully run a gRPC client and gRPC server in c++ now I wish to establish a communication between node A and gRPC server i.e. node B as in the attached image.

Are there any examples which I can refer to below is what I am looking for.

I have this node A with http message (GET method) which I need to parse i.e extract the message and run the request on node C. What is that I should look for in between Node A and gRPC server.

Thanks in Advance

http message to gRPC server

Vinay Shukla
  • 1,818
  • 13
  • 41
  • I am exploring `grpc-gateway` to act as `reverse-proxy` but IDL and proto file is taking too much time. Appreciate if someone can help me with a better approach or solution. – Vinay Shukla Apr 18 '18 at 10:26
  • It looks like Node A is non gRPC client, i think you may need write a custom adapter – Mandar Apr 20 '18 at 13:51

1 Answers1

9

Most of the times, if you have to use HTTP to contact a gRPC node, it most likely means that A is in fact a browser or browser-like environment, since you can simply instantiate a gRPC client on pretty much anything else.

If that's your situation, then I'd suggest having a look at grpc-web which aims to address that specific situation.

  • Hi Frank, appreciate your answer would be happy to accept the answer but if you could please help me with an example where I can use my existing c++ greeter_server to read this http message from HTTP client. Or how that can be done – Vinay Shukla Apr 23 '18 at 07:32
  • If you want to keep the format of the http message as is, then you will have to write logic to interpret it and manually populate a peotobuf. I can't really give you more details than that since I don't know what the message looks like. –  Apr 23 '18 at 11:37
  • I accept your answer @Mark will get back when I get the format of mesage. Thanks a lot – Vinay Shukla Apr 24 '18 at 07:16