is-online icon indicating copy to clipboard operation
is-online copied to clipboard

Is it possible to pass URL in config?

Open freddy-daniel opened this issue 5 years ago • 8 comments

freddy-daniel avatar Apr 05 '19 12:04 freddy-daniel

It's not in the docs, so no, it's not currently possible. Why do you need it? What problem would it solve?

sindresorhus avatar Apr 05 '19 19:04 sindresorhus

It's not in the docs, so no, it's not currently possible. Why do you need it? What problem would it solve?

It's necessary to detect my server is running or not. We cannot relay on connection with google.com. Because if your ISP allow only google.com. This entire module will fail it's purpose.

freddy-daniel avatar Apr 08 '19 06:04 freddy-daniel

We used to support a hostnames option, but it was removed in https://github.com/sindresorhus/is-online/commit/302d8e581046aa5513ecf8c067662474b793516f. I think we should bring it back, but only try the those hostnames if all the 3 current checks fail.

@silverwind Thoughts?

sindresorhus avatar Jun 11 '19 15:06 sindresorhus

Yes, please. I need this option too. Thanks!

ayalpani avatar Jun 19 '19 14:06 ayalpani

It's a good news

freddy-daniel avatar Jun 20 '19 08:06 freddy-daniel

@sindresorhus i'd like to take this one :)

deadcoder0904 avatar Sep 29 '19 12:09 deadcoder0904

@deadcoder0904 Go ahead :) Don't forget to add tests and docs (readme + index.d.ts).

sindresorhus avatar Sep 29 '19 12:09 sindresorhus

@freddy-daniel You can use is-reachable pacakge: https://www.npmjs.com/package/is-reachable

pegasuspect avatar Oct 01 '19 16:10 pegasuspect