struct

LavinMQ::IPMatcher

Inherits Struct < Value < Object

Matches IP addresses against either exact IPs or CIDR ranges

Constructors

new(type : Type, network : Bytes, mask : Bytes)
Source
parse(source : String) : IPMatcher

Parse from config string: "192.168.0.0/24", "10.0.0.1", "2001:db8::1/128", or "2001:db8::1"

Source

Class methods

parse_list(sources : String) : Array(IPMatcher)

Parse a comma-separated list of IP addresses or CIDR ranges from config. Raises on any invalid entry so a misconfigured trusted-source list fails loudly at startup instead of silently collapsing to an empty (trust-all) list.

Source

Instance methods

matches?(address : String) : Bool

Check if an IP address matches this matcher

Source

Nested types