HTTP/2 from fly-proxy to an app is now supported with http handler

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
15 Likes

Wasnt this a day 1 Fly feature from atleast a year ago? H2C to your fly VM proc from the edge proxy?

It was supported before only without http handler. So fly-proxy was forwarding raw TCP connection to the VM and none of the HTTP-only features, like routing headers or retries, worked in this case.

1 Like