Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudflare-ips

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by500%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 09 Sep 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc