http middleware for converting connect http request to grpc request #787
-
I'm building a gRPC-server as a mux handler that is supposed to chain via http middlewares and then ultimately apply What is a proper way to set up http middleware for connect converter that does not know anything about grpc/protobuf types (an isolated http handler func)? Basically, I want to transiently convert inbound http request into a grpc-compliant http request with all appropriate headers, etc. Seeing the envoy http filter I am sure this is possible as |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Jus discovered https://github.com/connectrpc/vanguard-go, but IIUIC it needs to wrap the grpcServer and what I need should only work with |
Beta Was this translation helpful? Give feedback.
-
Vanguard generally looks like a perfect tool for the job. 😍 |
Beta Was this translation helpful? Give feedback.
-
Hey Rauan, it is correct that it's possible to convert a Connect request to a gRPC request without knowledge of the Protobuf schema - as long as both use the same codec (JSON or Protobuf binary). This is out of scope for |
Beta Was this translation helpful? Give feedback.
Hey Rauan, it is correct that it's possible to convert a Connect request to a gRPC request without knowledge of the Protobuf schema - as long as both use the same codec (JSON or Protobuf binary).
This is out of scope for
connect-go
, but Vanguard supports this translation (and a bit more) and should do what you want -vanguard.Transcoder
is ahttp.Handler
. If you have any questions or feature request, it's best to open an issue in the Vanguard repository.