From 362547eaab3f861b0866776079d756e9a8397f80 Mon Sep 17 00:00:00 2001 From: Luna Yao <40349250+ZnqbuZ@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:48:08 +0200 Subject: [PATCH] use localhost as default hostname --- easytier/src/common/config.rs | 2 +- easytier/src/web_client/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/easytier/src/common/config.rs b/easytier/src/common/config.rs index 16eb8650..405fdc91 100644 --- a/easytier/src/common/config.rs +++ b/easytier/src/common/config.rs @@ -583,7 +583,7 @@ impl ConfigLoader for TomlConfigLoader { hostname.unwrap_or_else(|| { sanitize( hostname::get() - .unwrap_or_default() + .unwrap_or_else(|_| "localhost".into()) .to_string_lossy() .as_ref(), ) diff --git a/easytier/src/web_client/mod.rs b/easytier/src/web_client/mod.rs index 50681478..5a61aaa7 100644 --- a/easytier/src/web_client/mod.rs +++ b/easytier/src/web_client/mod.rs @@ -227,7 +227,7 @@ pub async fn run_web_client( global_ctx.set_flags(flags); let hostname = hostname.unwrap_or_else(|| { hostname::get() - .unwrap_or_default() + .unwrap_or_else(|_| "localhost".into()) .to_string_lossy() .into_owned() });