Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcode plaintext to binary requests #17

Closed
lmondada opened this issue Apr 9, 2024 · 2 comments
Closed

Transcode plaintext to binary requests #17

lmondada opened this issue Apr 9, 2024 · 2 comments

Comments

@lmondada
Copy link

lmondada commented Apr 9, 2024

Thank you for your great work and great project.

I have a betterproto+grpclib server backend (i.e. in Python) and was having a hard time debugging grpc-web requests as all communications were binary. I switched to connectRPC, motivated by the much better support for typescript browser code and plaintext requests.

However, after setting up the connect <-> gRPC envoy bridge as demonstrated in this repo, I have realised that plaintext connect requests are not transcoded to binary gRPC. My backend does not support JSON requests, so I am stuck using connect with binary format, thus losing the benefits from using connect in the first place.

Is adding a feature request in envoy to support this transcoding in the bridge the right approach? Do you know of a way to solve this in the short term, e.g. plugging in some additional envoy filter in the stack? I've tried using Envoy's grpc json transcoder, but without success.

@emcfarlane
Copy link

Hi Imondada, transcoding the descriptor from json to proto is currently not supported. The issue being that it would require the descriptors to perform the translation. A trade off was made to keep the implementation simple as usually adding JSON support for servers is easy to add, in go for instance this is a one liner. You may be interested in vanguard-go which is a go library that can act as a reverse proxy and supports translation.

@lmondada
Copy link
Author

Thanks Ed, that makes sense. I will look into adding JSON support to my python stack then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants