Socket
Socket
Sign inDemoInstall

cloudflare-ips

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cloudflare-ips

The list of CloudFlare IPs (IP ranges) to be used in the "trust proxy" configurations.


Version published
Weekly downloads
176
increased by2414.29%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

CloudFlare IP Ranges

build status npm version npm downloads

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 IPs
  • onError: (err: Error) => void — a callback that is triggered on error (optional)
  • options: { inteval: number } — allows to tweak the default settings (optional)

License

Copyright © 2017-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE.txt file.


Made with ♥ by Konstantin Tarkus (@koistya, blog)

Keywords

FAQs

Last updated on 09 Sep 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc