Enable upgrades on http module
This commit is contained in:
parent
cbf7a03836
commit
698236cdb4
1 changed files with 11 additions and 8 deletions
19
src/https.rs
19
src/https.rs
|
@ -77,14 +77,17 @@ pub async fn serve_https(
|
||||||
match tls_acceptor.accept(socket).await {
|
match tls_acceptor.accept(socket).await {
|
||||||
Ok(stream) => {
|
Ok(stream) => {
|
||||||
debug!("TLS handshake was successfull");
|
debug!("TLS handshake was successfull");
|
||||||
let http_conn = Http::new().serve_connection(
|
let http_conn = Http::new()
|
||||||
stream,
|
.serve_connection(
|
||||||
service_fn(move |req: Request<Body>| {
|
stream,
|
||||||
let https_config = config.clone();
|
service_fn(move |req: Request<Body>| {
|
||||||
let proxy_config: Arc<ProxyConfig> = rx_proxy_config.borrow().clone();
|
let https_config = config.clone();
|
||||||
handle_outer(remote_addr, req, https_config, proxy_config)
|
let proxy_config: Arc<ProxyConfig> =
|
||||||
}),
|
rx_proxy_config.borrow().clone();
|
||||||
);
|
handle_outer(remote_addr, req, https_config, proxy_config)
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.with_upgrades();
|
||||||
let timeout = tokio::time::sleep(MAX_CONNECTION_LIFETIME);
|
let timeout = tokio::time::sleep(MAX_CONNECTION_LIFETIME);
|
||||||
tokio::pin!(http_conn, timeout);
|
tokio::pin!(http_conn, timeout);
|
||||||
let http_result = loop {
|
let http_result = loop {
|
||||||
|
|
Loading…
Reference in a new issue