From efd562b38d394a8697d14fc3a7557d0610a88554 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 14 Mar 2024 05:55:12 +0100 Subject: [PATCH 1/2] extend example --- config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config b/config index 18a8ff407..0920a02c6 100644 --- a/config +++ b/config @@ -14,7 +14,8 @@ # CalDAV server hostnames separated by a comma # IPv4 syntax: address:port # IPv6 syntax: [address]:port -# For example: 0.0.0.0:9999, [::]:9999 +# Hostname syntax (using "getaddrinfo" to resolve to IPv4/IPv6 adress(es)): hostname:port +# For example: 0.0.0.0:9999, [::]:9999, localhost:9999 #hosts = localhost:5232 # Max parallel connections From b16bc212f61a2b72a1c17b9cab7e81926cae1f14 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 14 Mar 2024 05:55:45 +0100 Subject: [PATCH 2/2] correct IPv4/IPv6 address output --- radicale/server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale/server.py b/radicale/server.py index 30946a2a7..b220afa04 100644 --- a/radicale/server.py +++ b/radicale/server.py @@ -67,7 +67,10 @@ def format_address(address: ADDRESS_TYPE) -> str: if not isinstance(host, str): raise NotImplementedError("Unsupported address format: %r" % (address,)) - return "[%s]:%d" % (host, port) + if host.find(":") == -1: + return "%s:%d" % (host, port) + else: + return "[%s]:%d" % (host, port) class ParallelHTTPServer(socketserver.ThreadingMixIn,