1
0
mirror of https://github.com/actix/actix-website synced 2024-11-27 18:12:57 +01:00
actix-website/content/docs/http2.md
2021-02-26 18:48:27 +00:00

1.3 KiB

title menu weight
HTTP/2 docs_protocols 250

actix-web automatically upgrades connections to HTTP/2 if possible.

Negotiation

HTTP/2 protocol over TLS without prior knowledge requires TLS ALPN.

Currently, only rust-openssl has support.

alpn negotiation requires enabling the feature. When enabled, HttpServer provides the bind_openssl method.

[dependencies]
actix-web = { version = "{{< actix-version "actix-web" >}}", features = ["openssl"] }
openssl = { version = "0.10", features = ["v110"] }

{{< include-example example="http2" file="main.rs" section="main" >}}

Upgrades to HTTP/2.0 schema described in rfc section 3.2 is not supported. Starting HTTP/2 with prior knowledge is supported for both clear text connection and tls connection. rfc section 3.4.

Check out examples/tls for a concrete example.