Documentation
a project

Module Namespaces

Caddy guest modules are loaded generically as interface{} or any types. In order for the host modules to be able to use them, the loaded guest modules are usually type-asserted to a known type first. This page describes the mapping from module namespaces to Go types for all the standard modules.

Documentation for non-standard module namespaces can be found with the documentation for the host module that defines them.

Namespace Expected Interface Type Description Notes
caddy.App Caddy app
admin.api caddy.AdminRouter

caddy.AdminHandler
Registers HTTP routes for admin

HTTP handler middleware
caddy.config_loaders caddy.ConfigLoader Loads a config ⚠️ Experimental
caddy.fs fs.FS Virtual file system ⚠️ Experimental
caddy.listeners caddy.ListenerWrapper Wrap network listeners
caddy.logging.encoders zapcore.Encoder Log entry encoder
caddy.logging.encoders.filter logging.LogFieldFilter Log field filter
caddy.logging.writers caddy.WriterOpener Log writers
caddy.storage caddy.StorageConverter Storage backends
dns.providers certmagic.DNSProvider DNS challenge solver
events.handlers caddyevents.Handler Event handlers ⚠️ Experimental
http.authentication.hashes caddyauth.Comparer

caddyauth.Hasher
Password comparers

Password hashers
http.authentication.providers caddyauth.Authenticator HTTP authentication providers
http.encoders encode.Encoding

encode.Encoder
Creates an encoder (compression)

Encodes a data stream
http.handlers caddyhttp.MiddlewareHandler HTTP handlers
http.ip_sources caddyhttp.IPRangeSource IP ranges for trusted proxies
http.matchers caddyhttp.RequestMatcher

caddyhttp.CELLibraryProducer
HTTP request matchers

Support for CEL expressions


(Optional)
http.precompressed encode.Precompressed Supported precompress mappings
http.reverse_proxy.circuit_breakers reverseproxy.CircuitBreaker Reverse proxy circuit breakers
http.reverse_proxy.selection_policies reverseproxy.Selector Load balancing selection policies
http.reverse_proxy.transport http.RoundTripper HTTP reverse proxy transports
http.reverse_proxy.upstreams reverseproxy.UpstreamSource Dynamic upstream source ⚠️ Experimental
tls.ca_pool.source caddytls.CA Source of trusted root certs
tls.certificates caddytls.CertificateLoader TLS certificate source
tls.client_auth caddytls.ClientCertificateVerifier Verifies client certificates
tls.get_certificate certmagic.Manager TLS certificate manager ⚠️ Experimental
tls.handshake_match caddytls.ConnectionMatcher TLS connection matcher
tls.issuance certmagic.Issuer TLS certificate issuer
tls.leaf_cert_loader caddytls.LeafCertificateLoader Loads trusted leaf certs
tls.permission caddytls.OnDemandPermission Whether to obtain a cert for a domain ⚠️ Experimental
tls.stek caddytls.STEKProvider TLS session ticket key source

Namespaces marked as "Experimental" are subject to change. (Please develop with them so we can finalize their interfaces!)