The correct Caddyfile is the one without the udp/0.0.0.0:443 line.
It’s not obvious (yet), but HTTP/3 requires TLS to operate, and I don’t think that server has TLS enabled, because there’s no way Caddy can serve TLS with the config you’ve given it. There’s no certificates, nor way for it to get certificates, for the address 0.0.0.0:443.
So, you can use a proper hostname and obtain a real certificate:
example.com
...
Or you can set up on-demand TLS to get certificates at handshake-time:
0.0.0.0:443
tls {
# NOTE: this is still a TODO, so not yet implemented
# in the v2 Caddyfile and it might be different than this
ask <your endpoint here>
}
But the easiest thing is to just make your own certificate and provide them:
0.0.0.0:443
tls cert.pem key.pem
You’ll get cert errors that way, but at least you’ll have TLS.