Skip to content

marvnet/iscaptive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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) => {

    })

About

Node.js library for detecting captive portals

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published