【问题标题】:Can reverse proxy for both grpc and grpc-web with envoy?可以使用特使对 grpc 和 grpc-web 进行反向代理吗?
【发布时间】:2021-09-10 08:56:35
【问题描述】:

我有 grpc 服务器、Web 应用程序和移动应用程序。对于 Web 应用程序,我使用特使代理从我的域中的 grpc web 反向到 grpc 服务器。但是这个只有 grpc web 可以通过 envoy 连接到我的服务器,我使用 grpc 运行的应用程序无法连接它。我想使用 grpc-web 和 grpc 通过我的域连接到我的 gprc 服务器。任何人都可以帮我解释和解决这个问题。谢谢大家

这是我的特使设置

admin:
  access_log_path: /tmp/admin_access.log
  address:
    socket_address: { address: 0.0.0.0, port_value: 9901 }

static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address: { address: 0.0.0.0, port_value: 9090 }
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          codec_type: auto
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: local_service
              domains: ["*"]
              routes:
              - match: { prefix: "/" }
                route:
                  cluster: echo_service
                  timeout: 0s
                  max_stream_duration:
                    grpc_timeout_header_max: 0s
              cors:
                allow_origin_string_match:
                - prefix: "*"
                allow_methods: GET, PUT, DELETE, POST, OPTIONS
                allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
                max_age: "1728000"
                expose_headers: custom-header-1,grpc-status,grpc-message
          http_filters:
          - name: envoy.filters.http.grpc_web
          - name: envoy.filters.http.cors
          - name: envoy.filters.http.router
  clusters:
  - name: echo_service
    connect_timeout: 0.25s
    type: logical_dns
    http2_protocol_options: {}
    lb_policy: round_robin
    load_assignment:
      cluster_name: cluster_0
      endpoints:
        - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: server
                    port_value: 8080

【问题讨论】:

    标签: proxy dns grpc envoyproxy grpc-web


    【解决方案1】:

    不确定确切的问题是什么?目前需要使用 Envoy 将 grpc-web 翻译成 grpc。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-21
      • 2021-04-27
      • 2021-11-22
      • 2020-07-12
      • 2019-04-02
      • 1970-01-01
      • 2021-04-16
      • 1970-01-01
      相关资源
      最近更新 更多