All Projects → sindresorhus → Is Online

sindresorhus / Is Online

Licence: mit
Check if the internet connection is up

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Is Online

Is Reachable
Check if servers are reachable
Stars: ✭ 249 (-72.15%)
Mutual labels:  online, detect, network, internet, ping, connectivity, browser
Connectivity
Detect if the network is up (do we have connectivity?)
Stars: ✭ 58 (-93.51%)
Mutual labels:  detect, network, browser
connection checker
Android library for checking the internet connectivity of a device.
Stars: ✭ 26 (-97.09%)
Mutual labels:  detect, internet, ping
Gcping
Measure your latency to GCP regions
Stars: ✭ 405 (-54.7%)
Mutual labels:  network, ping, browser
Reactivenetwork
Android library listening network connection state and Internet connectivity with RxJava Observables
Stars: ✭ 2,484 (+177.85%)
Mutual labels:  network, internet
Awesome Online Earning
💰Ways to earn extra
Stars: ✭ 70 (-92.17%)
Mutual labels:  online, internet
speed-cloudflare-cli
📈 Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (-88.93%)
Mutual labels:  internet, ping
Nock Nock
🚪 Monitor and validate your websites to maintain maximum uptime.
Stars: ✭ 339 (-62.08%)
Mutual labels:  network, ping
Deadman
deadman is a curses-based host status checking application using ping
Stars: ✭ 214 (-76.06%)
Mutual labels:  network, ping
Hisocket
It is a lightweight client socket solution, you can used it in C# project or Unity3d
Stars: ✭ 275 (-69.24%)
Mutual labels:  network, ping
Bgpalerter
Software to monitor streams of BGP data. Pre-configured for real-time detection of visibility loss, RPKI invalid announcements, hijacks, and more.
Stars: ✭ 367 (-58.95%)
Mutual labels:  network, internet
Pale Moon
Pale Moon web browser
Stars: ✭ 512 (-42.73%)
Mutual labels:  internet, browser
Mylg
Network Diagnostic Tool
Stars: ✭ 2,538 (+183.89%)
Mutual labels:  network, ping
Linux Wifi Hotspot
Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
Stars: ✭ 434 (-51.45%)
Mutual labels:  network, internet
Fast Android Networking
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀
Stars: ✭ 5,346 (+497.99%)
Mutual labels:  network, internet
V Offline
🔌 Simple VueJS component to detect offline & online changes.
Stars: ✭ 307 (-65.66%)
Mutual labels:  online, network
Vieb
Vim Inspired Electron Browser - Vim bindings for the web by design
Stars: ✭ 175 (-80.43%)
Mutual labels:  network, browser
Hxphotopicker
图片/视频选择器 - 支持LivePhoto、GIF图片选择、3DTouch预览、在线下载iCloud上的资源、编辑图片/视频、浏览网络图片 功能 Imitation wx photo/image picker - support for LivePhoto, GIF image selection, 3DTouch preview, Download the resources on iCloud online, browse the web image function
Stars: ✭ 2,363 (+164.32%)
Mutual labels:  network, browser
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (-13.98%)
Mutual labels:  online, network
Flutter offline
✈️ A tidy utility to handle offline/online connectivity like a Boss
Stars: ✭ 644 (-27.96%)
Mutual labels:  network, connectivity

is-online

Check if the internet connection is up

Works in Node.js and the browser (with a bundler).

In the browser you have navigator.onLine, but it's useless as it only tells you if there's a local connection, and not whether the internet is accessible.

Install

$ npm install is-online

Usage

const isOnline = require('is-online');

(async () => {
	console.log(await isOnline());
	//=> true
})();

API

isOnline(options?)

options

Type: object

timeout

Type: number
Default: 5000

Milliseconds to wait for a server to respond.

ipVersion

Type: number
Values: 4 | 6
Default: 4

Internet Protocol version to use. This is an advanced option that is usually not necessary to be set, but it can prove useful to specifically assert IPv6 connectivity.

How it works

The following checks are run in parallel:

  • Retrieve icanhazip.com (or ipify.org as fallback) via HTTPS.
  • Query myip.opendns.com and o-o.myaddr.l.google.com DNS entries. (Node.js only)
  • Retrieve Apple's Captive Portal test page (this is what iOS does). (Node.js only)

When any check succeeds, the returned Promise is resolved to true.

Proxy support

To make it work through proxies, you need to set up global-agent.

Maintainers

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].