std.ip2str
Available inall subroutines.
Converts the IP address (IPv4 or IPv6) to a string.
The Domain Name Service (DNS) is not consulted, so the numeric form is returned.
The inverse conversion is available as
std.str2ip
.
Example
if (std.ip2str(std.str2ip(req.http.Fastly-Client-IP, "192.0.2.2")) ~ my_acl) { ...}
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)