0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-30 22:34:15 -05:00
caddy/caddytest/integration/caddyfile_adapt/bind_ipv6.txt
Francis Lavoie 93a7a45e7e
httpcaddyfile: Fix incorrect handling of IPv6 bind addresses (#4532)
The `net.JoinHostPort()` function has some naiive logic for handling IPv6, it just checks if the host part has a `:` and if so it wraps the host part with `[ ]` but this causes our network type prefix to get wrapped as well, which is invalid for `caddy.NetworkAddress`. Instead, we can just concatenate the host and port manually here to avoid this side-effect.
2022-01-18 11:27:43 -07:00

330 B

example.com { bind tcp6/[::] }

{ "apps": { "http": { "servers": { "srv0": { "listen": [ "tcp6/[::]:443" ], "routes": [ { "match": [ { "host": [ "example.com" ] } ], "terminal": true } ] } } } } }