mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-02 16:58:30 +00:00
Merge pull request #1438 from pbiering/fix-1313
extend example and proper format for logged IPv4/IPv6 addresses
This commit is contained in:
commit
020fd560a3
2 changed files with 6 additions and 2 deletions
3
config
3
config
|
@ -14,7 +14,8 @@
|
||||||
# CalDAV server hostnames separated by a comma
|
# CalDAV server hostnames separated by a comma
|
||||||
# IPv4 syntax: address:port
|
# IPv4 syntax: address:port
|
||||||
# IPv6 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
|
#hosts = localhost:5232
|
||||||
|
|
||||||
# Max parallel connections
|
# Max parallel connections
|
||||||
|
|
|
@ -67,6 +67,9 @@ def format_address(address: ADDRESS_TYPE) -> str:
|
||||||
if not isinstance(host, str):
|
if not isinstance(host, str):
|
||||||
raise NotImplementedError("Unsupported address format: %r" %
|
raise NotImplementedError("Unsupported address format: %r" %
|
||||||
(address,))
|
(address,))
|
||||||
|
if host.find(":") == -1:
|
||||||
|
return "%s:%d" % (host, port)
|
||||||
|
else:
|
||||||
return "[%s]:%d" % (host, port)
|
return "[%s]:%d" % (host, port)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue