Skip to content

2.4.0-beta.3: HTTP/2 to the servers, long-lived streams, a gRPC recipe

Pre-release
Pre-release

Choose a tag to compare

@avandeputte avandeputte released this 21 Nov 07:16
· 1 commit to beta since this release

2.4.0-beta.3: HTTP/2 to the servers for gRPC, and long-lived streams

A beta of 2.4.0. It adds two things for gRPC and other long-lived HTTP streams, from #37, and a recipe for them. It replaces beta.2, which had the same two things with the tick in another section of the form. The Cloudflare Tunnel feature of beta.1 is unchanged.

Getting the beta

  • Updates page: tick Also offer beta versions, then update.
  • Docker: ghcr.io/avandeputte/haproxy-manager:2.4.0-beta.3
  • install.sh: the usual command with --ref beta.

HTTP/2 to the servers

HAProxy spoke HTTP/1.1 to a server whatever visitors spoke to it, and gRPC cannot do without HTTP/2. There is now a tick for it:

  • In the service form, in the Service section under Forward to: HTTP/2 to the servers.
  • On a Real Server: HTTP/2 to the server.

To an https:// server HTTP/2 is offered and the server chooses (alpn h2,http/1.1), so a server that only knows HTTP/1.1 still works. To an http:// server it is HTTP/2 only (proto h2). An HTTP health check on the traffic port speaks the same.

In the form, and a recipe

  • PROXY protocol moves with it: both now sit in the Service section, under Forward to, since both say how the servers are spoken to. They were under Balancing and timeouts.
  • A gRPC service recipe, under Web: HTTPS, HTTP/2 to the servers, a connect check and a Server timeout of a day.

A service that waits longer than the listener

A stream that is silent in both directions, a bidirectional gRPC call above all, was closed after 50 seconds: the visitor's side is held to the listener's client timeout, whatever the service's Server timeout says.

On HAProxy 3.0 or later, a service whose Server timeout is longer than the client timeout now gives its own requests that longer client timeout too. Nothing has to be ticked: set the service's Server timeout to how long its streams may sit idle.

  • This changes existing services at the next Apply. Every HTTP service with a Server timeout longer than the client timeout (many recipes set one) gets a line on its listener, and its visitors' idle streams then live as long as the Server timeout says.
  • It is never shortened. A service with a short Server timeout leaves the client timeout alone.
  • HAProxy before 3.0 does not know the directive, so on Debian 12, Ubuntu 24.04 and Rocky 9 nothing is written. There, add timeout client 1h to the listener's Extra directives. The container image carries HAProxy 3.4, and Debian 13 has 3.0.

The guide's Tuning page describes both.

Tested

With a real gRPC server over TLS behind the container image (HAProxy 3.4): without the tick every call failed with 502; with it calls worked; a stream silent in both directions was cut at 50 s before the client-timeout change and was still open at 80 s after it. The same stream stayed open through a bare HAProxy 3.0 with the same lines. HAProxy 2.6, 2.8 and 2.9 refuse the directive, which is why they are not given it.

Not tried: an http:// gRPC server (proto h2 passed HAProxy's configuration check only), NetBird itself, gRPC through the Cloudflare Tunnel.