Functions
In addition to everything that expr already provides, we also have some extra built-in functions that you can use in your expressions:
cidr
Check if an IP address is in a CIDR range. Example:
geoip
Check if an IP address belongs to a specific country, using data from https://github.com/Loyalsoldier/v2ray-rules-dat
Example:
geosite
Check if a domain belongs to a specific category, using data from https://github.com/Loyalsoldier/v2ray-rules-dat
Example:
lookup
Perform a DNS lookup for a domain, returns the list of IP addresses (both A and AAAA records) returned by the DNS server. If the server address is not specified, it uses the system default. Note that this uses the standard DNS protocol (not DNS over TLS, DNS over HTTPS, for example), and you must specify both IP and port for the server address (e.g. 8.8.8.8:53
).
Example: