update hyper to 1.0 and other libs

This commit is contained in:
Nikita Vilunov 2023-12-10 22:22:26 +01:00
parent cefd6f8df0
commit 77d175ccd9
3 changed files with 467 additions and 308 deletions

768
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -41,8 +41,9 @@ publish = false
[dependencies]
anyhow.workspace = true
figment = { version = "0.10.8", features = ["env", "toml"] } # configuration files
hyper = { version = "1.0.0-rc.3,<1.0.0-rc.4", features = ["server", "http1"] } # http server
http-body-util = "0.1.0-rc.3"
hyper = { version = "1.0.1", features = ["server", "http1"] } # http server
http-body-util = "0.1.0"
hyper-util = { version = "0.1", features = ["server", "http1", "tokio"] }
serde.workspace = true
serde_json = "1.0.93"
tokio.workspace = true

View File

@ -7,6 +7,7 @@ use hyper::body::Bytes;
use hyper::server::conn::http1;
use hyper::service::service_fn;
use hyper::{Method, Request, Response, StatusCode};
use hyper_util::rt::TokioIo;
use prometheus::{Encoder, Registry as MetricsRegistry, TextEncoder};
use serde::{Deserialize, Serialize};
use tokio::net::TcpListener;
@ -52,6 +53,7 @@ async fn main_loop(
_ = &mut termination => break,
result = listener.accept() => {
let (stream, _) = result?;
let stream = TokioIo::new(stream);
let metrics = metrics.clone();
let rooms = rooms.clone();
let storage = storage.clone();