aws-cf-ip-ranges

node v10.14.1
version: 1.0.0
endpointsharetweet
const request = require('request'); request('https://ip-ranges.amazonaws.com/ip-ranges.json', function (error, response, body) { var arr = JSON.parse(body), ips = []; arr["prefixes"].forEach(function (x) { if (x["service"] == "CLOUDFRONT") { ips.push(x["ip_prefix"]) } }) arr["ipv6_prefixes"].forEach(function (x) { if (x["service"] == "CLOUDFRONT") { ips.push(x["ipv6_prefix"]) } }) console.log(JSON.stringify(ips)); });
Loading…

no comments

    sign in to comment