tower-rs / tower-h2

An HTTP/2.0 client and server `Service` implementation.
MIT License
89 stars 18 forks source link

tower-h2 vs h2 #62

Closed nevi-me closed 5 years ago

nevi-me commented 5 years ago

TL,DR: If I'm using tower-grpc for grpc server, should I use h2 to create a generic client, or what benefits would using tower-h2 bring over directly using h2?

I'm working on a project that uses https://github.com/improbable-eng/grpc-web to proxy connections to grpc services. It's not able to connect to tower-grpc, always throws a protocol error (I'll file bug on tower-grpc if I can find the cause).

To sidestep that, and to hopefully remove the dependency on grpc-web, I'm looking into implementing grpc-web in Rust. Looks like a key requirement is being able to send http2 requests to gRPC services.

Which will be easier to use to achieve the below? (perhaps also considering stability and documentation so one doesn't struggle):

> create a generic h2 request and pass server address:port, method, uri and proto message as bytes
> get response and grab raw bytes to pass back to the client