【问题标题】:gRPC endpoint with non-root path具有非根路径的 gRPC 端点
【发布时间】:2017-03-17 13:30:07
【问题描述】:

也许(希望)我遗漏了一些非常简单的东西,但我似乎无法弄清楚。

我有一组 gRPC 服务,我想放在 nghttpx 代理后面。为此,我需要能够使用非根 url 上的通道配置我的客户端。例如。

channel = grpc.insecure_channel('localhost:50051/myapp')
stub = MyAppStub(channel)

这并没有通过代理立即工作(它只是挂起),所以我在子上下文中使用服务器进行了测试。

server = grpc.server(executor)
service_pb2.add_MyAppServicer_to_server(
    MyAppService(), server)
server.add_insecure_port('{}:{}/myapp'.format(hostname, port))
server.start()

我得到以下内容

E1103 21:00:13.880474000 140735277326336 server_chttp2.c:159] 
{"created":"@1478203213.880457000","description":"OS Error",
"errno":8,"file":"src/core/lib/iomgr/resolve_address_posix.c",
"file_line":115,"os_error":"nodename nor servname provided, or not known",
"syscall":"getaddrinfo","target_address":"[::]:50051/myapp"}

所以问题是 - 是否可以在非根 url 上创建 gRPC 通道?

【问题讨论】:

    标签: grpc


    【解决方案1】:

    正如here 确认的那样,这是不可能的。我将通过 nghttpx 中的子域路由流量。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 2020-12-15
      • 2016-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多