Commit
Message
Changed Files (2)
-
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a11ad5..031289d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Fixed +- Server now binds to both IPv4 (127.0.0.1) and IPv6 (::1) localhost addresses, fixing connection issues in browsers that prefer IPv6 (e.g. Zen Browser). + ## [0.5.0] - 2026-06-23 ### Added -
modified src/web/mod.rs
diff --git a/src/web/mod.rs b/src/web/mod.rs index c12755b..1a348ee 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -123,7 +123,7 @@ pub async fn run_server( bind_addr, bind_port, workers ); - HttpServer::new(move || { + let mut server = HttpServer::new(move || { App::new() .app_data(tera.clone()) .app_data(db_pool.clone()) @@ -135,10 +135,20 @@ pub async fn run_server( .service(handlers::api_search) .service(handlers::opensearch) }) - .workers(workers) - .bind((bind_addr.as_str(), bind_port))? - .run() - .await + .workers(workers); + server = server.bind((bind_addr.as_str(), bind_port))?; + + if bind_addr == "127.0.0.1" { + match std::net::TcpListener::bind(("::1", bind_port)) { + Ok(listener) => { + server = server.listen(listener)?; + info!("Also listening on [::1]:{}", bind_port); + } + Err(e) => info!("Could not bind IPv6 ::1:{}: {} (IPv4 only)", bind_port, e), + } + } + + server.run().await } pub fn interleave(per_engine: &[Vec<ResultEntry>]) -> Vec<ResultEntry> {