feat: client (wip), still unstable for http2 due to alpn issues

This commit is contained in:
Jun Kurihara 2023-11-28 22:22:40 +09:00
commit a9f5e0ede5
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
15 changed files with 199 additions and 70 deletions

View file

@ -57,11 +57,11 @@ pub(super) fn apply_upstream_options_to_request_line<B>(
) -> anyhow::Result<()> {
for opt in upstream.options.iter() {
match opt {
UpstreamOption::ForceHttp11Upstream => *req.version_mut() = hyper::Version::HTTP_11,
UpstreamOption::ForceHttp11Upstream => *req.version_mut() = http::Version::HTTP_11,
UpstreamOption::ForceHttp2Upstream => {
// case: h2c -> https://www.rfc-editor.org/rfc/rfc9113.txt
// Upgrade from HTTP/1.1 to HTTP/2 is deprecated. So, http-2 prior knowledge is required.
*req.version_mut() = hyper::Version::HTTP_2;
*req.version_mut() = http::Version::HTTP_2;
}
_ => (),
}