Versions in this module Expand all Collapse all v0 v0.5.0 Nov 24, 2026 v0.4.0 Nov 19, 2026 Changes in this version + func CanonicalOrigin(value string) (string, error) + func ClientIP(ctx context.Context) string + func NewHandler(next http.Handler, opts Options) (http.Handler, error) + func Origin(ctx context.Context) string + func ParseTrustedProxies(raw []string) ([]netip.Prefix, error) + func RequestOrigin(ctx context.Context) string + func ResolveClientIP(r *http.Request, prefixes []netip.Prefix) string + func TrustsAddress(addr netip.Addr, trustedProxies []netip.Prefix) bool + func TrustsPeer(remoteAddr string, trustedProxies []netip.Prefix) bool + type AccessLog struct + Logger *slog.Logger + SuccessLevel slog.Level + func (h AccessLog) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HostPolicy struct + func NewHostPolicy(opts HostPolicyOptions) (*HostPolicy, error) + func (s *HostPolicy) ExternalURL() string + type HostPolicyOptions struct + AllowLocal bool + ExternalURL string + type Options struct + GeoIP OriginChecker + Hosts *HostPolicy + Logger *slog.Logger + SuccessLevel slog.Level + TrustedProxies []netip.Prefix + type OriginChecker interface + CheckOrigin func(clientIP string) (origin string, allowed bool)