// Provision sets up the module.
Provision sets up the module.
// Provision sets up the module .
func (h *Handler) Provision(ctx caddy.Context) error {
	for _, s := range h.Allow {
		_, n, err := net.ParseCIDR(s)
		if err != nil {
			return fmt.Errorf("invalid subnet '%s': %w", s, err)
		}
		h.rules = append(h.rules, proxyprotocol.Rule{Timeout: time.Duration(h.Timeout), Subnet: n})
	}
	h.tidyRules()
	h.logger = ctx.Logger(h)
	return nil
}
func ( h * Handler ) Provision ( ctx caddy . Context ) error { for _ , s := range h . Allow { _ , n , err := net . ParseCIDR ( s ) if err != nil { return fmt . Errorf ( " " , s , err ) } h . rules = append ( h . rules , proxyprotocol . Rule { Timeout : time . Duration ( h . Timeout ) , Subnet : n } ) } h . tidyRules ( ) h . logger = ctx . Logger ( h ) return nil }
Provision sets up the module.
Provision sets up the module .