Constimport { DialAddressSchema } from "@viaalink/caddy-api-client";
// Valid addresses
DialAddressSchema.parse("localhost:3000"); // OK
DialAddressSchema.parse("192.168.1.1:8080"); // OK
DialAddressSchema.parse("unix//run/app/web.sock"); // OK
DialAddressSchema.parse("tcp6/[::1]:8080"); // OK
// Invalid - missing port
DialAddressSchema.parse("localhost"); // throws
Dial address schema: a Caddy network address for an upstream.
Accepts the forms Caddy's
reverse_proxydials:host:port,[ipv6]:porttcp/host:port(alsotcp4,tcp6,udp,udp4,udp6)unix//abs/path.sock(alsounix+h2c/,unixgram/,unixpacket/); a unix address is a socket path and has no port{placeholder}, which Caddy resolves per request