Newbie Paintball Master

    cloudflare-detect

    1.0.10 • Public • Published

    cloudflare-detect Build Status

    Detect whether a site is running behind Cloudflare.

    Install

    ~ ❯❯❯ npm install --save cloudflare-detect
    

    Usage

    const cloudflareDetect = require('cloudflare-detect');
     
    cloudflareDetect('nikolaskama.me').then(cf => {
        console.log(cf);
        //=> true
    });
     
    cloudflareDetect('google.com').then(cf => {
        console.log(cf);
        //=> false
    });

    API

    cloudflareDetect(targets, [options])

    Returns a Promise for a boolean which is true if any of the targets are running behind Cloudflare.

    targets

    Type: string Array

    One or more targets to check. Can either be a full URL like https://hostname or just hostname. When the protocol is missing from a target http is assumed.

    options

    timeout

    Type: number

    Timeout in milliseconds after which a request is considered failed. Default: 5000.

    Credits

    • cloudflare-ip - a lot of the code for verifying that the host's IP address is within Cloudflare's range has been adapted from this repo (which doesn't seem to be maintained anymore) by danneu.
    • is-reachable - some of the IP verification & DNS lookup code, as well as the format of the readme file, has been adapted from this repo by sindresorhus.

    Related

    • cf-detect.now - A minimal service to check whether a site is running behind Cloudflare.

    License

    MIT © Nikolaos Kamarinakis

    Install

    npm i cloudflare-detect

    DownloadsWeekly Downloads

    55

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    6.92 kB

    Total Files

    6

    Last publish

    Collaborators

    • k4m4