9
votes

I have two network services - a gRPC client and gRPC server. Server is written in .NET Core, hence HTTP/2 for gRPC is enforced. Client however is a .NET Framework 4.7.2 web app hosted on IIS 8.5, so it only supports HTTP/1.1.

Since it will take some time to upgrade the client I was thinking if it is possible to use HTTP/1.1 instead of HTTP/2 on the server side, but I cannot find any information how to achieve that.

Is it possible to use HTTP/1.1 for gRPC server written in .NET Core? And if so - how?

2

2 Answers

10
votes

No, you cannot use gRPC on HTTP 1.1; you may be able to use the Grpc.Core Google transport implementation, however, instead of the managed Microsoft bits; this targets .NET Standard 1.5 and .NET Standard 2.0, so should work on .NET Core, and uses an OS-specific unmanaged binary (chttp2) for the transport.

For client-side, there is virtually no difference between the two; only the actual channel creation changes, between:

GrpcChannel.ForAddress(...)

with the Microsoft transport, and

new Channel(...)

with the Google transport. All of the rest of the APIs are shared (in Grpc.Core.Api)

4
votes

No. The RPC call is done only over HTTP/2. This allows gRPC users to automatically leverage all the features of the protocol.