feat(upgrade): Moved HTTP upgrades off Body to a new API (#2337)
Closes #2086 BREAKING CHANGE: The method `Body::on_upgrade()` is gone. It is essentially replaced with `hyper::upgrade::on(msg)`.
This commit is contained in:
@@ -58,7 +58,7 @@ async fn proxy(client: HttpClient, req: Request<Body>) -> Result<Response<Body>,
|
||||
// `on_upgrade` future.
|
||||
if let Some(addr) = host_addr(req.uri()) {
|
||||
tokio::task::spawn(async move {
|
||||
match req.into_body().on_upgrade().await {
|
||||
match hyper::upgrade::on(req).await {
|
||||
Ok(upgraded) => {
|
||||
if let Err(e) = tunnel(upgraded, addr).await {
|
||||
eprintln!("server io error: {}", e);
|
||||
|
||||
Reference in New Issue
Block a user