如何将HTTP消息从另一个节点解析到gRPC服务器 [英] How to parse HTTP message from another node to a gRPC server
问题描述
我可以在 c ++ $中成功运行
gRPC客户端
和 gRPC服务器
c $ c>现在我希望在节点A和gRPC服务器之间建立通信,即节点B
,如附图所示。
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.
我有这个节点 A
带 http
消息(GET方法)我需要解析即提取消息并在节点上运行请求C.我应该在Node A和gRPC服务器之间寻找什么。
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.
提前致谢
推荐答案
大多数情况下,如果你必须使用HTTP联系gRPC节点,很可能意味着A实际上是浏览器或浏览器类似环境,因为你可以简单地在其他任何东西上实例化一个gRPC客户端。
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.
如果这是你的情况,那么我建议看一下 grpc-web 旨在解决这一特定情况。
If that's your situation, then I'd suggest having a look at grpc-web which aims to address that specific situation.
这篇关于如何将HTTP消息从另一个节点解析到gRPC服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!