From 463c3d98f5ee42354b8ec7f5cbdd9730ade4c6b2 Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 23 May 2022 01:00:45 -0400 Subject: [PATCH] bind to ipv6 too --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e38e0b5..4fca1e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -216,9 +216,17 @@ async fn main() -> std::io::Result<()> { }) .bind(( if reverse_proxy { - "127.0.0.1" + std::net::Ipv4Addr::LOCALHOST } else { - "0.0.0.0" + std::net::Ipv4Addr::UNSPECIFIED + }, + port, + ))? + .bind(( + if reverse_proxy { + std::net::Ipv6Addr::LOCALHOST + } else { + std::net::Ipv6Addr::UNSPECIFIED }, port, ))?