问题描述
所以我有一个dapr服务托管在:192.168.1.34:50459
我正在尝试使它使用grpc-web与我的Web应用程序通信。为此,我有一个特使代理人(根据https://github.com/grpc/grpc-web/issues/347)。
我的envoy.yaml文件如下:
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0,port_value: 4949 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match: { prefix: "/" }
route:
cluster: greeter_service
max_grpc_timeout: 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.grpc_web
- name: envoy.cors
- name: envoy.router
clusters:
- name: greeter_service
connect_timeout: 0.25s
type: logical_dns
http2_protocol_options: {}
lb_policy: round_robin
hosts: [{ socket_address: { address: 192.168.1.34,port_value: 50459 }}]
它应该收听0.0.0.0:4949,并将其转发到192.168.1.34:50459
但是当我使用以下方式启动该代理
docker run -d -v envoy.yaml:/etc/envoy/envoy.yaml:ro -p 4949:4949 -p 50459:50459 envoyproxy/envoy:v1.15.0
将其路由到0.0.0.0:50459
有人知道如何解决吗?
解决方法
我对envoy不太了解,但是您可以将其配置为登录到挂载路径吗?查看路由是否实际配置?另外,我假设您要在Dapr run命令中设置--dapr-grpc-port explicitly
?您是否曾尝试将其设置为差异端口以防发生冲突?