summaryrefslogtreecommitdiff
path: root/test_util/src/servers/ws.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-12-27 17:59:57 +0100
committerGitHub <noreply@github.com>2023-12-27 11:59:57 -0500
commitc2414db1f68d27db8ca6f192f0ff877f1394164c (patch)
tree528da9796f400557204bfdb8e4d44d64173036ce /test_util/src/servers/ws.rs
parent33acd437f52b418a8413a302dd8902abad2eabec (diff)
refactor: simplify hyper, http, h2 deps (#21715)
Main change is that: - "hyper" has been renamed to "hyper_v014" to signal that it's legacy - "hyper1" has been renamed to "hyper" and should be the default
Diffstat (limited to 'test_util/src/servers/ws.rs')
-rw-r--r--test_util/src/servers/ws.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/test_util/src/servers/ws.rs b/test_util/src/servers/ws.rs
index f820c8bbd..48e4cae8b 100644
--- a/test_util/src/servers/ws.rs
+++ b/test_util/src/servers/ws.rs
@@ -15,11 +15,11 @@ use h2::server::Handshake;
use h2::server::SendResponse;
use h2::Reason;
use h2::RecvStream;
-use hyper1::upgrade::Upgraded;
-use hyper1::Method;
-use hyper1::Request;
-use hyper1::Response;
-use hyper1::StatusCode;
+use hyper::upgrade::Upgraded;
+use hyper::Method;
+use hyper::Request;
+use hyper::Response;
+use hyper::StatusCode;
use hyper_util::rt::TokioIo;
use pretty_assertions::assert_eq;
use std::pin::Pin;
@@ -126,8 +126,8 @@ fn spawn_ws_server<S>(stream: S, handler: WsHandler)
where
S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Unpin + Send + 'static,
{
- let service = hyper1::service::service_fn(
- move |mut req: http::Request<hyper1::body::Incoming>| async move {
+ let service = hyper::service::service_fn(
+ move |mut req: http::Request<hyper::body::Incoming>| async move {
let (response, upgrade_fut) = fastwebsockets::upgrade::upgrade(&mut req)
.map_err(|e| anyhow!("Error upgrading websocket connection: {}", e))?;
@@ -148,7 +148,7 @@ where
let io = TokioIo::new(stream);
tokio::spawn(async move {
- let conn = hyper1::server::conn::http1::Builder::new()
+ let conn = hyper::server::conn::http1::Builder::new()
.serve_connection(io, service)
.with_upgrades();