[pbs-devel] [PATCH proxmox 07/17] http: websocket: update to http/hyper 1

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Mar 26 16:23:11 CET 2025


use the new Empty body type, since Body is now a trait and no longer a
struct containing different body types.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 proxmox-http/Cargo.toml           | 3 ++-
 proxmox-http/src/websocket/mod.rs | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/proxmox-http/Cargo.toml b/proxmox-http/Cargo.toml
index 7668c6ee..6eed6e23 100644
--- a/proxmox-http/Cargo.toml
+++ b/proxmox-http/Cargo.toml
@@ -92,7 +92,7 @@ http-helpers = [ "dep:base64", "dep:http", "dep:proxmox-sys", "dep:serde_json",
 websocket = [
     "dep:base64",
     "dep:futures",
-    "dep:hyper",
+    "dep:http",
     "dep:openssl",
     "dep:proxmox-sys",
     "dep:proxmox-io",
@@ -101,4 +101,5 @@ websocket = [
     "proxmox-io?/tokio",
     "tokio?/io-util",
     "tokio?/sync",
+    "body",
 ]
diff --git a/proxmox-http/src/websocket/mod.rs b/proxmox-http/src/websocket/mod.rs
index eef5fa8e..576fc18d 100644
--- a/proxmox-http/src/websocket/mod.rs
+++ b/proxmox-http/src/websocket/mod.rs
@@ -11,11 +11,11 @@ use std::task::{Context, Poll};
 
 use anyhow::{bail, format_err, Error};
 use futures::select;
-use hyper::header::{
+use http::header::{
     HeaderMap, HeaderValue, CONNECTION, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY,
     SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION, UPGRADE,
 };
-use hyper::{Body, Response, StatusCode};
+use http::{Response, StatusCode};
 use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadBuf};
 use tokio::sync::mpsc;
 
@@ -25,6 +25,8 @@ use futures::ready;
 use proxmox_io::ByteBuffer;
 use proxmox_lang::io_format_err;
 
+use crate::Body;
+
 // see RFC6455 section 7.4.1
 #[derive(Debug, Clone, Copy)]
 #[repr(u16)]
-- 
2.39.5





More information about the pbs-devel mailing list