mirror of
https://github.com/actix/actix-website
synced 2024-12-01 03:24:36 +01:00
36b3f9a3d7
fixes #235
1.4 KiB
1.4 KiB
title | menu | weight |
---|---|---|
HTTP/2 | docs_protocols | 250 |
Actix Web will prefer HTTP/2 connections if the client signals support for it via TLS ALPN.
Negotiation
When either of the rustls
or openssl
features are enabled, HttpServer
provides the bind_rustls method and bind_openssl methods, respectively.
[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 described in RFC 7540 §3.2 are not supported. Starting HTTP/2 with prior knowledge is supported for both cleartext and TLS connections (RFC 7540 §3.4) (when using the lower level actix-http
service builders).
Check out the TLS examples for concrete example.