fly-proxy
has supported HTTP/2 on the edge for a long time, but HTTP/2 requests got downgraded to HTTP/1 requests on the last hop (proxy → app) when http
handler is used.
It’s now possible to tell fly-proxy
that an app supports HTTP/2 (h2c with prior knowledge), which enables HTTP/2 only workloads, like gRPC, to work with http
handler.
gRPC (or any other HTTP/2 only workload) can now be used over shared IP, requests will be retried if an instance is unavailable and routing headers like fly-prefer-region
respected.
The feature is gated behind an HTTP option in fly.toml
as for some of the languges/framework HTTP/2 cleartext support has to be enabled explicitly. For example, for Go, this is done using golang.org/x/net/http2/h2c
package.
To configure HTTP/2 support:
[http_service.http_options]
h2_backend = true
or
[services.ports.http_options]
h2_backend = true