mirror of
https://github.com/tokio-rs/axum.git
synced 2025-03-28 17:27:23 +01:00
Update some examples (#364)
This commit is contained in:
parent
afabded385
commit
b7002f68d5
5 changed files with 22 additions and 16 deletions
examples
|
@ -6,8 +6,8 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
axum = { path = "../..", features = ["ws"] }
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
futures = "0.3"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tower = { version = "0.4", features = ["util"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
futures = "0.3"
|
||||
|
|
|
@ -6,16 +6,21 @@
|
|||
//! cargo run -p example-chat
|
||||
//! ```
|
||||
|
||||
use axum::extract::ws::{Message, WebSocket, WebSocketUpgrade};
|
||||
use axum::extract::Extension;
|
||||
use axum::handler::get;
|
||||
use axum::response::{Html, IntoResponse};
|
||||
use axum::AddExtensionLayer;
|
||||
use axum::Router;
|
||||
use axum::{
|
||||
extract::{
|
||||
ws::{Message, WebSocket, WebSocketUpgrade},
|
||||
Extension,
|
||||
},
|
||||
handler::get,
|
||||
response::{Html, IntoResponse},
|
||||
AddExtensionLayer, Router,
|
||||
};
|
||||
use futures::{sink::SinkExt, stream::StreamExt};
|
||||
use std::collections::HashSet;
|
||||
use std::net::SocketAddr;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
net::SocketAddr,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
use tokio::sync::broadcast;
|
||||
|
||||
// Our shared state
|
||||
|
|
|
@ -6,8 +6,8 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
axum = { path = "../.." }
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
hyper = { version = "0.14", features = ["full"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-rustls = "0.22"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
tokio-rustls = "0.22.0"
|
||||
hyper = { version = "0.14", features = ["full"] }
|
||||
|
|
|
@ -10,7 +10,8 @@ use std::{fs::File, io::BufReader, sync::Arc};
|
|||
use tokio::net::TcpListener;
|
||||
use tokio_rustls::{
|
||||
rustls::{
|
||||
internal::pemfile::certs, internal::pemfile::pkcs8_private_keys, NoClientAuth, ServerConfig,
|
||||
internal::pemfile::{certs, pkcs8_private_keys},
|
||||
NoClientAuth, ServerConfig,
|
||||
},
|
||||
TlsAcceptor,
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
axum = { path = "../.." }
|
||||
axum-server = { version = "0.1", features = ["tls-rustls"] }
|
||||
axum-server = { version = "0.2", features = ["tls-rustls"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
|
|
Loading…
Add table
Reference in a new issue