fix log alt-svc
This commit is contained in:
parent
22a4896693
commit
b6322c42a1
2 changed files with 13 additions and 4 deletions
|
|
@ -7,3 +7,6 @@ pub const MAX_CLIENTS: usize = 512;
|
||||||
pub const MAX_CONCURRENT_STREAMS: u32 = 16;
|
pub const MAX_CONCURRENT_STREAMS: u32 = 16;
|
||||||
// #[cfg(feature = "tls")]
|
// #[cfg(feature = "tls")]
|
||||||
pub const CERTS_WATCH_DELAY_SECS: u32 = 10;
|
pub const CERTS_WATCH_DELAY_SECS: u32 = 10;
|
||||||
|
|
||||||
|
#[cfg(feature = "h3")]
|
||||||
|
pub const H3_ALT_SVC_MAX_AGE: u32 = 60;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Highly motivated by https://github.com/felipenoris/hyper-reverse-proxy
|
// Highly motivated by https://github.com/felipenoris/hyper-reverse-proxy
|
||||||
use super::Proxy;
|
use super::Proxy;
|
||||||
use crate::{error::*, log::*};
|
use crate::{constants::*, error::*, log::*};
|
||||||
use hyper::{
|
use hyper::{
|
||||||
client::connect::Connect,
|
client::connect::Connect,
|
||||||
header::{HeaderMap, HeaderValue},
|
header::{HeaderMap, HeaderValue},
|
||||||
|
|
@ -112,9 +112,15 @@ where
|
||||||
{
|
{
|
||||||
if self.globals.http3 {
|
if self.globals.http3 {
|
||||||
if let Some(port) = self.globals.https_port {
|
if let Some(port) = self.globals.https_port {
|
||||||
res_backend
|
res_backend.headers_mut().insert(
|
||||||
.headers_mut()
|
hyper::header::ALT_SVC,
|
||||||
.insert("alt-svc", format!("h3=\":{}\"", port).parse().unwrap());
|
format!(
|
||||||
|
"h3=\":{}\"; ma={}, h3-29\":{}\"; ma={}",
|
||||||
|
port, H3_ALT_SVC_MAX_AGE, port, H3_ALT_SVC_MAX_AGE
|
||||||
|
)
|
||||||
|
.parse()
|
||||||
|
.unwrap(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue