Skip to content

Conversation

bouk
Copy link

@bouk bouk commented Oct 7, 2025

This allows applying the GrpcWebLayer to any kind of Service, not just ones that tonic generates.

Motivation

This makes it possible to use tonic-web as a grpc-web proxy to a gRPC server implemented in another language for example, I'm using it to proxy a Python gRPC service over grpc-web.

Solution

We have to be generic over the ResBody of the wrapped service and then box that into a tonic::body::Body. I've made the default values of the body type parameters tonic::body::Body so I believe this change is backwards compatible.

This is a redo of #1366

This allows applying the GrpcWebLayer to any kind of Service, not just ones that tonic generates. This makes it possible to use tonic-web as a grpc-web proxy to a gRPC server implemented in another language for example.
@bouk bouk force-pushed the bouk/tonic-web-proxy branch from 973e2dc to c8a4676 Compare October 7, 2025 12:37
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

Successfully merging this pull request may close these issues.

1 participant