From 5bf2fefe2e172b497cbaeb8e9a06a24be14cb75c Mon Sep 17 00:00:00 2001 From: Razvan Dimescu Date: Sun, 29 Mar 2026 22:59:51 +0300 Subject: [PATCH] fix: respect proxy bind_addr config, don't auto-widen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auto-widen silently overrode an explicit config value — the user's config should be the source of truth. Now the proxy always uses the configured bind_addr, and the warning fires whenever it's 127.0.0.1. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/main.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 77d1408..5505392 100644 --- a/src/main.rs +++ b/src/main.rs @@ -208,8 +208,6 @@ async fn main() -> numa::Result<()> { }); let zone_count: usize = ctx.zone_map.values().map(|m| m.len()).sum(); - let dns_is_public = config.server.bind_addr.starts_with("0.0.0.0"); - // Build banner rows, then size the box to fit the longest value let api_url = format!("http://localhost:{}", api_port); let proxy_label = if config.proxy.enabled { @@ -309,7 +307,7 @@ async fn main() -> numa::Result<()> { ); if let Some(ref label) = proxy_label { row("Proxy", g, label); - if !config.lan.enabled && !dns_is_public && config.proxy.bind_addr == "127.0.0.1" { + if config.proxy.bind_addr == "127.0.0.1" { let y = "\x1b[38;2;204;176;59m"; // yellow row( "", @@ -387,16 +385,11 @@ async fn main() -> numa::Result<()> { axum::serve(listener, app).await.unwrap(); }); - // Proxy binds 0.0.0.0 when LAN is enabled or DNS is already on 0.0.0.0 (cross-machine access) - let proxy_bind: std::net::Ipv4Addr = if config.lan.enabled || dns_is_public { - std::net::Ipv4Addr::UNSPECIFIED - } else { - config - .proxy - .bind_addr - .parse() - .unwrap_or(std::net::Ipv4Addr::LOCALHOST) - }; + let proxy_bind: std::net::Ipv4Addr = config + .proxy + .bind_addr + .parse() + .unwrap_or(std::net::Ipv4Addr::LOCALHOST); // Spawn HTTP reverse proxy for .numa domains if config.proxy.enabled {