iscaptive

1.0.0 • Public • Published

iscaptive

Node.js library for detecting captive portals

Features

  • Detect captive portals
  • Choose captive server
    • isCaptive (Powered by AWS CloudFront)

Installation

Yarn:

yarn add iscaptive

NPM:

npm install iscaptive

Usage

The library consists of one main function.

Basic example

const isCaptive = require("iscaptive")

isCaptive()
    .then((captive) => {
        if(captive) { // you are behind a captive portal or have no internet
            console.log("Captive!")
        } else { // you have full access to the internet
            console.log("No captive!")
        }
    })

Advanced usage

You can specify another captive server (currently only our own captive server) and protocol (http or https (default)).

Captive server:

isCaptive("marvnet")
    .then((captive)) {

    }

Protocol:

isCaptive("marvnet", "https")
    .then((captive) => {

    })

Readme

Keywords

none

Package Sidebar

Install

npm i iscaptive

Weekly Downloads

1

Version

1.0.0

License

GPL-3.0-or-later

Unpacked Size

39 kB

Total Files

13

Last publish

Collaborators

  • marvman