diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 3 | ||||
| -rw-r--r-- | crates/whirl_config/Config.default.toml | 2 | ||||
| -rw-r--r-- | crates/whirl_config/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_server/src/lib.rs | 18 |
4 files changed, 19 insertions, 6 deletions
diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs index ddee9ff..d3c3a0c 100644 --- a/crates/whirl_api/src/lib.rs +++ b/crates/whirl_api/src/lib.rs @@ -71,7 +71,8 @@ impl Api { pub fn make() -> tokio::task::JoinHandle<()> { tokio::spawn(async move { crate::Api::listen(&*format!( - "0.0.0.0:{}", + "{}:{}", + whirl_config::Config::get().whirlsplash.ip, whirl_config::Config::get().whirlsplash.api.port )) .await; diff --git a/crates/whirl_config/Config.default.toml b/crates/whirl_config/Config.default.toml index 3bf6fa0..5de09be 100644 --- a/crates/whirl_config/Config.default.toml +++ b/crates/whirl_config/Config.default.toml @@ -4,7 +4,7 @@ version = "0.1.0" [whirlsplash] worldsmaster_username = "WORLDSMASTER" -ip = "0.0.0.0" +ip = "127.0.0.1" api.port = 8080 [whirlsplash.prompt] diff --git a/crates/whirl_config/src/lib.rs b/crates/whirl_config/src/lib.rs index 218a249..b5f9d6e 100644 --- a/crates/whirl_config/src/lib.rs +++ b/crates/whirl_config/src/lib.rs @@ -95,7 +95,7 @@ impl Default for Config { version: "0.1.0".to_string(), whirlsplash: WhirlsplashConfig { worldsmaster_username: "WORLDSMASTER".to_string(), - ip: "0.0.0.0".to_string(), + ip: "127.0.0.1".to_string(), api: WhirlsplashApiConfig { port: 80 }, diff --git a/crates/whirl_server/src/lib.rs b/crates/whirl_server/src/lib.rs index 7f9df14..ad7d05e 100644 --- a/crates/whirl_server/src/lib.rs +++ b/crates/whirl_server/src/lib.rs @@ -80,7 +80,11 @@ pub trait Server { counter += 1; let state = Arc::clone(&state); - debug!("accepted client at {}", address); + debug!( + "server of type {} accepted client at {}", + server_type.to_string(), + address + ); tokio::spawn(async move { if let Err(e) = Self::handle(state, stream, address, counter).await { @@ -119,7 +123,11 @@ pub mod make { pub fn distributor() -> JoinHandle<()> { tokio::spawn(async move { crate::distributor::Distributor::listen( - &*format!("0.0.0.0:{}", Config::get().distributor.port), + &*format!( + "{}:{}", + Config::get().whirlsplash.ip, + Config::get().distributor.port + ), ServerType::Auto, ) .await @@ -136,7 +144,11 @@ pub mod make { pub fn hub() -> JoinHandle<()> { tokio::spawn(async move { crate::hub::Hub::listen( - &*format!("0.0.0.0:{}", Config::get().hub.port), + &*format!( + "{}:{}", + Config::get().whirlsplash.ip, + Config::get().hub.port + ), ServerType::Room, ) .await |