Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
fixed upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Nov 23, 2023
1 parent 4e58ae5 commit 2deb5d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zia-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use hyper::body::{Bytes, Incoming};
use hyper::service::Service;
use hyper::upgrade::Upgraded;
use hyper::{Request, Response, StatusCode};
use hyper::server::conn::http1;
use hyper_util::rt::TokioIo;
use pin_project_lite::pin_project;
use tokio::io::WriteHalf;
Expand Down Expand Up @@ -134,10 +135,10 @@ async fn main() -> anyhow::Result<()> {

let service = ConnectionHandler { read, write };

let conn = hyper::server::conn::http1::Builder::new().serve_connection(io, service);
let conn = http1::Builder::new().serve_connection(io, service);

tokio::spawn(async move {
if let Err(err) = conn.await {
if let Err(err) = conn.with_upgrades().await {
error!("Error: {:?}", err);
}
});
Expand Down

0 comments on commit 2deb5d9

Please sign in to comment.