
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@shortcm/cloudfront-ip-ranges
Advanced tools
Get Cloudfront IPs for use in trust proxy configurations
Get Cloudfront IPs for use in trust proxy configurations.
This package will be updated if Cloudfront ever decides to change the endpoints for retrieving current IPs. We will most likely never see a breaking change for this package.
Requires node 8 or newer.
npm install --save cloudfront-ip-ranges
For use in an Express environment please see Express documentation on trust proxies.
It is recommended to use setInterval for updating the IP list periodically.
const cfIPranges = require('cloudfront-ip-ranges')
cfIPranges.updateTrustProxy(app)
setInterval(() => {
cfIPranges.updateTrustProxy(app)
}, 1000*60*60*12)
Useful if you need to list other proxies alongside the Cloudfront ones.
const cfIPranges = require('cloudfront-ip-ranges')
cfIPranges.updateIPs()
.then((ips) => {
app.set('trust proxy', ['loopback', ...ips])
})
| Method | Info |
|---|---|
| getIpRange | By default returns Promise<string[]>. |
| updateTrustProxy | Takes an Express app instance as an argument. Returns Promise<void>. |
| Version | Release notes |
|---|---|
| 0.1.0 | Initial release. |
FAQs
Get Cloudfront IPs for use in trust proxy configurations
We found that @shortcm/cloudfront-ip-ranges demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.