Skip to content

Commit

Permalink
feat(viz): export serve_with_upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Nov 20, 2023
1 parent 5394d3b commit e508200
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/websocket-chat/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{net::SocketAddr, sync::Arc};
use tokio::net::TcpListener;
use tokio::sync::broadcast::{channel, Sender};
use viz::{
get, serve,
get, serve_with_upgrades,
types::{Message, Params, State, WebSocket},
HandlerExt, IntoHandler, IntoResponse, Request, RequestExt, Response, ResponseExt, Result,
Router, Tree,
Expand Down Expand Up @@ -67,7 +67,7 @@ async fn main() -> Result<()> {
let (stream, addr) = listener.accept().await?;
let tree = tree.clone();
tokio::task::spawn(async move {
if let Err(err) = serve(stream, tree, Some(addr)).await {
if let Err(err) = serve_with_upgrades(stream, tree, Some(addr)).await {
eprintln!("Error while serving HTTP connection: {err}");
}
});
Expand Down
2 changes: 1 addition & 1 deletion viz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ pub use responder::Responder;
#[cfg(any(feature = "http1", feature = "http2"))]
mod serve;
#[cfg(any(feature = "http1", feature = "http2"))]
pub use serve::serve;
pub use serve::{serve, serve_with_upgrades};

/// TLS
pub mod tls;
Expand Down

0 comments on commit e508200

Please sign in to comment.