[Feature Request] Support "h2c"
See original GitHub issueI know that okhttp now have already supported h2-prior-knowledge
.
However, it is still inconvenient to use, because h2_prior_knowledge
cannot be used with other protocols at the same time.
In my project, I use okhttp to access the REST APIs of other modules inside the project. Because the project will eventually be deployed on the intranet, there is no incentive to use https. At the same time, I need to use okhttp to access some external resources on the Internet. At this time, I have to instantiate two OkHttpClient
s. It is very inconvenient to always pay attention to which one to access which resource.
If okhttp supports h2c
, it will be very convenient to be compatible with both h2
and http/1.1
servers.
And it also matches the spirit of okhttp that recommending only one OkHttpClient
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
It’s sadly to hear that.
Because
http/2
support binary data format, persistent tcp connections, multiplexing, and header compression and reuse,http/2
will have a lower latency thanhttp/1.1
and a higher throughput rate. So it will be the best companion for RPC. And for internal RPC,h2c
is easier to deploy thanh2
and has less stress on the hardware. For example, gRPC supports bothh2
andh2c
.