From b822e3a94c71436ee7d94e33c5be126c5d69a811 Mon Sep 17 00:00:00 2001
From: strawberry <strawberry@puppygock.gay>
Date: Sun, 26 May 2024 14:46:35 -0400
Subject: [PATCH] listen on IPv6 localhost by default

this is dual-stack by default on linux, resolves
issues with nginx using `localhost` and randomly
choosing between 127.0.0.1 and [::1], causing
intermittent upstream issues

Signed-off-by: strawberry <strawberry@puppygock.gay>
---
 src/core/config/mod.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs
index 4a58f7d77..b4e2886ac 100644
--- a/src/core/config/mod.rs
+++ b/src/core/config/mod.rs
@@ -1,7 +1,7 @@
 use std::{
 	collections::BTreeMap,
 	fmt::{self, Write as _},
-	net::{IpAddr, Ipv4Addr, SocketAddr},
+	net::{IpAddr, Ipv6Addr, SocketAddr},
 	path::PathBuf,
 };
 
@@ -875,7 +875,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 
 fn true_fn() -> bool { true }
 
-fn default_address() -> IpAddr { Ipv4Addr::LOCALHOST.into() }
+fn default_address() -> IpAddr { Ipv6Addr::LOCALHOST.into() }
 
 fn default_port() -> ListeningPort {
 	ListeningPort {
-- 
GitLab