Package Exports
- cloudflare-ips
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cloudflare-ips) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CloudFlare IP Ranges
The list of CloudFlare IPs (IP ranges) to be used in the trust proxy configurations.
How to Use
$ npm install cloudflare-ips # or, `yarn add cloudflare-ips`const express = require('express');
const cloudflareIPs = require('cloudflare-ips');
const app = express();
cloudflareIPs(
ips => app.set('trust proxy', ['loopback', ...ips]),
err => console.error(err.stack),
);
cloudflareIPs((err, ips) => {
app.set('trust proxy', ['loopback', ...ips]);
});
app.listen(8080);API
cloudFlareIPs(onUpdate, onError, options)
onUpdate:(ips: string[]) => void— a callback function accepting the list of IPsonError:(err: Error) => void— a callback that is triggered on error (optional)options:{ inteval: number }— allows to tweak the default settings (optional)
Related Projects
- Node.js API Starter Kit — Boilerplate and tooling for building data APIs with Docker, Node.js and GraphQL
License
Copyright © 2017-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE.txt file.