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

Support for gRPC (Tonic) #1052

Closed
rohitjoshi opened this issue May 24, 2022 · 2 comments
Closed

Support for gRPC (Tonic) #1052

rohitjoshi opened this issue May 24, 2022 · 2 comments

Comments

@rohitjoshi
Copy link

Feature Request

Supporting gRPC (tonic) based on the content-type header.
I came across "Combining Axum, Hyper, Tonic, and Tower for hybrid web/gRPC apps" which shows the gRPC with Axum but seems cumbersome.

Motivation

This will enable browser support and code reuse across both HTTP1/1 and gRPC clients.

Proposal

It would be good to provide native support with maybe a separate crate e.g. axum-grpc.

Alternatives

@davidpdrsn
Copy link
Member

Sounds like you're asking for this example https://github.com/tokio-rs/axum/blob/main/examples/rest-grpc-multiplex/src/main.rs. That combines a REST and gRPC service into one and dispatches based on the content-type. All possible thanks to tower::Service.

Actually tonic already uses axum internally for routing. See https://github.com/hyperium/tonic/blob/master/tonic/src/transport/service/router.rs

@rohitjoshi
Copy link
Author

Thanks. Closing..

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