alenas
February 8, 2023, 3:57pm
1
Seems like traefik proxy is not sending grpc-status OK trailers for grpc-web proxy, as these are required by grpc-dart implementation:
grpc-web might need to default grpc-status to 0 when missing · Issue #566 · grpc/grpc-dart (github.com)
When debugging the issue I get response 200 and response content through grpc-web, but it is missing trailers and then grpc-dart implementation shows error. There is no such error with Envoy as grpc-web proxy with the same container configurations. So I presume that something weird happens in traefik h2c handler.
svx
February 9, 2023, 1:45pm
2
Hi @alenas ! Thanks for your interest in Traefik!
Which version of Traefik do you use?
v3 comes with middleware for GRPC
alenas
February 9, 2023, 11:21pm
3
I tried with docker images versions 2.9.6 and 3.0.beta2
My dynamic config is like this:
http:
routers:
grpc-web:
entryPoints: grpc
middlewares: testHeader
service: srv-grpc-web
rule: PathPrefix(`/`)
services:
srv-grpc-web:
loadBalancer:
servers:
- url: h2c://127.0.0.1:5055
middlewares:
testHeader:
headers:
accessControlAllowMethods:
- GET
- PUT
- POST
- OPTIONS
accessControlAllowOriginList: '*'
accessControlAllowHeaders: '*'
accessControlExposeHeaders:
- custom-header-1
- grpc-status
- grpc-message
accessControlMaxAge: 1728000
svx
February 10, 2023, 1:56pm
4
Hi @alenas , for Traefik v3, did you activate the middleware for gRPC-web?
It seems, I can't spot that in your config?
alenas
February 10, 2023, 3:17pm
5
You are right I changed middleware config for v3 and it works now.
middlewares:
testHeader:
grpcWeb:
allowOrigins:
- "*"
Thanks a lot. Solved.