diff --git a/crates/bevnet-relay/Cargo.toml b/crates/bevnet-relay/Cargo.toml index da48be0..b46ea69 100644 --- a/crates/bevnet-relay/Cargo.toml +++ b/crates/bevnet-relay/Cargo.toml @@ -12,27 +12,9 @@ categories = ["network-programming", "game-development"] workspace = true [dependencies] -tokio = { version = "1.36.0", features = [ - "macros", - "rt-multi-thread", -], optional = true } -axum = { version = "0.7.4", features = ["ws"], optional = true } -lazy_static = { version = "1.4.0", optional = true } -futures = { version = "0.3.30", optional = true } -dashmap = { version = "5.5.3", optional = true } -rand = { version = "0.8.5", optional = true } - -[features] -default = [] -server = [ - "dep:tokio", - "dep:axum", - "dep:lazy_static", - "dep:futures", - "dep:dashmap", - "dep:rand", -] - -[[bin]] -name = "server" -required-features = ["server"] +tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +axum = { version = "0.7.4", features = ["ws"] } +lazy_static = "1.4.0" +futures = "0.3.30" +dashmap = "5.5.3" +rand = "0.8.5" diff --git a/crates/bevnet-relay/src/bin/server.rs b/crates/bevnet-relay/src/main.rs similarity index 98% rename from crates/bevnet-relay/src/bin/server.rs rename to crates/bevnet-relay/src/main.rs index 6bddbd1..0c51c83 100644 --- a/crates/bevnet-relay/src/bin/server.rs +++ b/crates/bevnet-relay/src/main.rs @@ -10,7 +10,6 @@ use lazy_static::lazy_static; use rand::Rng; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::task::JoinHandle; -use uuid::Uuid; lazy_static! { static ref CLIENTS: DashMap>> = DashMap::new(); @@ -19,7 +18,7 @@ lazy_static! { #[tokio::main] async fn main() { let app = Router::new().route( - "/relay", + "/", get(|ws: WebSocketUpgrade| async { ws.on_upgrade(handle) }), ); let listener = tokio::net::TcpListener::bind("0.0.0.0:80")