Skip to content

Commit

Permalink
[h2c] example should use serve_connection_with_upgrades
Browse files Browse the repository at this point in the history
Server has to explicitly opt-in to upgrade support.
  • Loading branch information
alexrudy committed May 20, 2024
1 parent 0ade9a8 commit 59510f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/src/h2c/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let router = h2c.clone();
tokio::spawn(async move {
let builder = Builder::new(TokioExecutor::new());
let conn = builder
.serve_connection(TokioIo::new(io), TowerToHyperService::new(router));
let conn = builder.serve_connection_with_upgrades(
TokioIo::new(io),
TowerToHyperService::new(router),
);
let _ = conn.await;
});
}
Expand Down

0 comments on commit 59510f9

Please sign in to comment.