1.0.0 • Published 6 years ago
iscaptive v1.0.0
iscaptive
Node.js library for detecting captive portals
Features
- Detect captive portals
- Choose captive server
- isCaptive (Powered by AWS CloudFront)
Installation
Yarn:
yarn add iscaptiveNPM:
npm install iscaptiveUsage
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) => {
})1.0.0
6 years ago