Re: Best way to check if there is internet?

2022-02-26 Thread Robert Latest via Python-list
Chris Angelico wrote: > Every language learns from every other. Except Visual Basic, which didn't learn anything from anywhere, and all that can be learned from it is how not to do it. Ugh. -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-26 Thread Peter J. Holzer
On 2022-02-22 12:31:42 +0400, Abdur-Rahmaan Janhangeer wrote: > A front end eng sent me this for how to check for the internet in JS > > https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-online > > But it also says: > > "This attribute is inherently unreliable. A computer

Re: Best way to check if there is internet?

2022-02-25 Thread Abdur-Rahmaan Janhangeer
> I never knew this. Where can I read more about this origin? https://python-history.blogspot.com/2009/01/personal-history-part-1-cwi.html?m=1 <> There are more sources which i cannot remember from the top of my head -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-25 Thread Abdur-Rahmaan Janhangeer
Yes i know that JS has switch from before I was referring to the pattern matching proposal. I cannot find the original place i read it from but here's the github one https://github.com/tc39/proposal-pattern-matching -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-25 Thread Greg Ewing
On 26/02/22 11:22 am, Chris Angelico wrote: What's the best language for swearing in? Ah, that one I can't help you with, although I've heard good things about French. :) Russian seems to be quite good for it too, judging by certain dashcam footage channels. -- Greg --

Re: Best way to check if there is internet?

2022-02-25 Thread Chris Angelico
On Sat, 26 Feb 2022 at 09:04, Barry Scott wrote: > > > > > On 25 Feb 2022, at 18:07, Abdur-Rahmaan Janhangeer > > wrote: > > > > Normally people put Python in the scripting category. > > I learnt typed languages like C++ and Java at first. > > People who learn languages like these tend to put >

Re: Best way to check if there is internet?

2022-02-25 Thread Barry Scott
> On 25 Feb 2022, at 18:07, Abdur-Rahmaan Janhangeer > wrote: > > Normally people put Python in the scripting category. > I learnt typed languages like C++ and Java at first. > People who learn languages like these tend to put > Python in a non-serious category. The post was > more ironic

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
On 25/02/2022 14.30, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2022-02-25 at 13:48:32 -0600, "Michael F. Stemper" wrote: On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: I have been following language feature proposals from various languages. Some decide to avoid Python's route, but

Re: Best way to check if there is internet?

2022-02-25 Thread Chris Angelico
On Sat, 26 Feb 2022 at 07:32, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-02-25 at 13:48:32 -0600, > "Michael F. Stemper" wrote: > > > On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: > > > > I have been following language feature proposals from various > > > languages. Some

Re: Best way to check if there is internet?

2022-02-25 Thread 2QdxY4RzWzUUiLuE
On 2022-02-25 at 13:48:32 -0600, "Michael F. Stemper" wrote: > On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: > > I have been following language feature proposals from various > > languages. Some decide to avoid Python's route, but others have been > > trying hard to catch up with Python.

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: I have been following language feature proposals from various languages. Some decide to avoid Python's route, but others have been trying hard to catch up with Python. One gleaming example is the switch case. JS recently proposed pattern

Re: Best way to check if there is internet?

2022-02-25 Thread Chris Angelico
On Sat, 26 Feb 2022 at 05:09, Abdur-Rahmaan Janhangeer wrote: > > Normally people put Python in the scripting category. You have a very interesting definition of "normal". ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-25 Thread Abdur-Rahmaan Janhangeer
Normally people put Python in the scripting category. I learnt typed languages like C++ and Java at first. People who learn languages like these tend to put Python in a non-serious category. The post was more ironic than litteral. After 5 years of following the mailing lists i realised that there

Re: Best way to check if there is internet?

2022-02-25 Thread Benjamin Schollnick
>>> Thanks for the in-between. I really like the Python comunity as, >>> even though it's a 'scripting' language, > > And we like you, even though you're only a ... > > In English, a statement like that is considered rather insulting. > >> To me, it's a programming language. In my usage, a

Re: Best way to check if there is internet?

2022-02-25 Thread Grant Edwards
On 2022-02-25, Michael F. Stemper wrote: > On 25/02/2022 06.49, Abdur-Rahmaan Janhangeer wrote: > >> Thanks for the in-between. I really like the Python comunity as, >> even though it's a 'scripting' language, And we like you, even though you're only a ... In English, a statement like that is

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
On 25/02/2022 06.49, Abdur-Rahmaan Janhangeer wrote: Thanks for the in-between. I really like the Python comunity as, even though it's a 'scripting' language, To me, it's a programming language. In my usage, a "script" is a bunch of OS commands. -- Michael F. Stemper Life's too important to

Re: Best way to check if there is internet?

2022-02-25 Thread Abdur-Rahmaan Janhangeer
Avi solved the captive portal problem above. It's by comparing the page content to a dynamic output. I was asking for wifi just in case i missed anything we did not yet discuss. I consider the thread closed, thanks everybody, it was very fruitful for me. Thanks for the in-between. I really like

Re: Best way to check if there is internet?

2022-02-23 Thread Robert Latest via Python-list
Abdur-Rahmaan Janhangeer wrote: > I've got my answers but the 'wandering' a bit > on this thread is at least connected to the topic ^^. > > Last question: If we check for wifi or ethernet cable connection? > > Wifi sometimes tell of connected but no internet connection. > So it detected that there

Re: Best way to check if there is internet?

2022-02-23 Thread Robert Latest via Python-list
Abdur-Rahmaan Janhangeer wrote: > Well, nice perspective. > > It's a valid consideration, sound theory > but poor practicality according to me. On the contrary: It is absolutely the right and only way to do it. > It you view it like this then between the moment > we press run or enter key on the

Re: Best way to check if there is internet?

2022-02-23 Thread 2QdxY4RzWzUUiLuE
On 2022-02-23 at 09:28:40 -0700, Akkana Peck wrote: > 2qdxy4rzwzuui...@potatochowder.com writes: > > I think someone said it way upthread: don't check, just do whatever you > > came to do, and it will work or it will fail (presumably, your program > > can tell the difference, regardless of a

Re: Best way to check if there is internet?

2022-02-23 Thread Chris Angelico
On Thu, 24 Feb 2022 at 03:39, Akkana Peck wrote: > > 2qdxy4rzwzuui...@potatochowder.com writes: > > I think someone said it way upthread: don't check, just do whatever you > > came to do, and it will work or it will fail (presumably, your program > > can tell the difference, regardless of a past

Re: Best way to check if there is internet?

2022-02-23 Thread Akkana Peck
2qdxy4rzwzuui...@potatochowder.com writes: > I think someone said it way upthread: don't check, just do whatever you > came to do, and it will work or it will fail (presumably, your program > can tell the difference, regardless of a past snapshot of being able to > retrieve data from an arbitrary

Re: Best way to check if there is internet?

2022-02-22 Thread Dennis Lee Bieber
On Wed, 23 Feb 2022 07:08:27 +0300, Abdur-Rahmaan Janhangeer declaimed the following: >The upcoming operation is short enough and >though we cannot assume that it will be the case >when we are running the operation, we sensibly >assume it will still be the case. > >This is more an extra check

Re: Best way to check if there is internet?

2022-02-22 Thread Abdur-Rahmaan Janhangeer
> > > Since you have to deal with things that you do not control changing > after you check what is the point in checking? You have to write the code > to recover anyway. > Well foe my usecase, the operation running is not in months or a really long time. As Avi mentionned above, that would be

Re: Best way to check if there is internet?

2022-02-22 Thread Barry
> On 22 Feb 2022, at 17:44, Abdur-Rahmaan Janhangeer > wrote: > > Well, nice perspective. > > It's a valid consideration, sound theory > but poor practicality according to me. > > It you view it like this then between the moment > we press run or enter key on the terminal, > our Python

Re: Best way to check if there is internet?

2022-02-22 Thread Abdur-Rahmaan Janhangeer
I've got my answers but the 'wandering' a bit on this thread is at least connected to the topic ^^. Last question: If we check for wifi or ethernet cable connection? Wifi sometimes tell of connected but no internet connection. So it detected that there is or there is no internet ... --

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Angelico
On Wed, 23 Feb 2022 at 05:38, Avi Gross via Python-list wrote: > It sounds to me like your main issue is not whether the internet is up right > now but whether the user has an internet connection. If they run the program > on a laptop at home or work then they may well be connected, but sitting

Re: Best way to check if there is internet?

2022-02-22 Thread Avi Gross via Python-list
not be. -Original Message- From: Abdur-Rahmaan Janhangeer To: Python Sent: Tue, Feb 22, 2022 12:32 pm Subject: Re: Best way to check if there is internet? Well, nice perspective. It's a valid consideration, sound theory but poor practicality according to me. It you view it like this then between

Re: Best way to check if there is internet?

2022-02-22 Thread Abdur-Rahmaan Janhangeer
Well, nice perspective. It's a valid consideration, sound theory but poor practicality according to me. It you view it like this then between the moment we press run or enter key on the terminal, our Python interpreter might get deleted. We never know, it can happen. Though it's nice to go in

Re: Best way to check if there is internet?

2022-02-22 Thread 2QdxY4RzWzUUiLuE
On 2022-02-09 at 11:15:34 +0400, Abdur-Rahmaan Janhangeer wrote: > I think for me having the internet means ability to request urls You can always ask. The real question is what will the response be? ;-) This entire exercise is a race condition, just like checking for that a file exists

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Angelico
On Wed, 23 Feb 2022 at 02:33, Chris Green wrote: > > Chris Angelico wrote: > > On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer > > wrote: > > > > > > As discussed here but, it would have been nevertheless great to have this > > > tiny function instead of > > > nothing > > > > > > >

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Green
Chris Angelico wrote: > On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer > wrote: > > > > As discussed here but, it would have been nevertheless great to have this > > tiny function instead of > > nothing > > > > Here's a function that determines whether or not you have an internet >

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Angelico
On Wed, 23 Feb 2022 at 01:06, Antoon Pardon wrote: > > > Op 22/02/2022 om 09:40 schreef Chris Angelico: > > On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer > > wrote: > >> As discussed here but, it would have been nevertheless great to have this > >> tiny function instead of > >> nothing

Re: Best way to check if there is internet?

2022-02-22 Thread Antoon Pardon
Op 22/02/2022 om 09:40 schreef Chris Angelico: On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer wrote: As discussed here but, it would have been nevertheless great to have this tiny function instead of nothing Here's a function that determines whether or not you have an internet

Aw: Re: Best way to check if there is internet?

2022-02-22 Thread Karsten Hilbert
> Is there any value whatsoever in a lie? Do we _know_ it's a lie ? Does a lie become a Falsed Truth once it becomes known ? Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-22 Thread Abdur-Rahmaan Janhangeer
Thanks for the function but i think having the function as described won't return True all time Me: dipping my foot in hot water, yes we can go ... In the sprit of "practicality beats purity", devs needs a function XD Kind Regards, Abdur-Rahmaan Janhangeer about

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Angelico
On Tue, 22 Feb 2022 at 19:40, Chris Angelico wrote: > > On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer > wrote: > > > > As discussed here but, it would have been nevertheless great to have this > > tiny function instead of > > nothing > > > > Here's a function that determines whether or

Re: Best way to check if there is internet?

2022-02-22 Thread Chris Angelico
On Tue, 22 Feb 2022 at 19:33, Abdur-Rahmaan Janhangeer wrote: > > As discussed here but, it would have been nevertheless great to have this > tiny function instead of > nothing > Here's a function that determines whether or not you have an internet connection. It's almost as reliable as some of

Re: Best way to check if there is internet?

2022-02-22 Thread Abdur-Rahmaan Janhangeer
On Mon, Feb 7, 2022 at 1:17 PM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Greetings, > > Using the standard library or 3rd party libraries, what's the > best way to check if there is internet? Checking if google.com > is reachable is good but I wonder if

Re: Best way to check if there is internet?

2022-02-09 Thread Avi Gross via Python-list
method might be better. -Original Message- From: Abdur-Rahmaan Janhangeer To: Python Sent: Wed, Feb 9, 2022 12:24 pm Subject: Re: Best way to check if there is internet? > This won't work if you're behind a captive portal: every URL you try to get will return successfu

Re: Best way to check if there is internet?

2022-02-09 Thread Abdur-Rahmaan Janhangeer
> This won't work if you're behind a captive portal: every URL you try to get will return successfully, but the content will be the captive portal page. Yes agree a pretty common scenario if you are moving around ... The solution is to test against a webpage you know the content will always be

Re: Best way to check if there is internet?

2022-02-09 Thread Abdur-Rahmaan Janhangeer
> Ah, but WHEN do those browsers report that? When attempting to connect to whatever the default "home" page has been set to? (Mine is configured to use https://www.google.com as the default page -- if my router is down, obviously the browser will time-out waiting for a response from Google, and

Re: Best way to check if there is internet?

2022-02-09 Thread Akkana Peck
Abdur-Rahmaan Janhangeer writes: > results = [] > with console.status("Checking internet ...", spinner="dots"): > for domain in domains: > try: > requests.get(domain) > results.append(1) > except Exception as e: > results.append(0) > if not any(results): > print('No internet connection') >

Re: Best way to check if there is internet?

2022-02-09 Thread Gisle Vanem
Abdur-Rahmaan Janhangeer wrote: It's a demo to get the idea behind, uses requests and the rich library. I'd never heard of 'Rich'. But d/l it and playing with it, I came up with this version with fat green spinner-bar: import requests from rich.console import Console def ensure_internet():

Re: Best way to check if there is internet?

2022-02-09 Thread Abdur-Rahmaan Janhangeer
It's a demo to get the idea behind, uses requests and the rich library. Kind Regards, Abdur-Rahmaan Janhangeer about | blog github Mauritius On Wed, Feb 9, 2022 at 12:24 PM Gisle Vanem

Re: Best way to check if there is internet?

2022-02-09 Thread Gisle Vanem
Abdur-Rahmaan Janhangeer wrote: Thanks everybody for the answers. It was very enlightening. Here's my solution: # using rich console def ensure_internet(): console = Console() domains = [ 'https://google.com', 'https://yahoo.com', 'https://bing.com', 'https://www.ecosia.org',

Re: Best way to check if there is internet?

2022-02-08 Thread Abdur-Rahmaan Janhangeer
Thanks everybody for the answers. It was very enlightening. Here's my solution: # using rich console def ensure_internet(): console = Console() domains = [ 'https://google.com', 'https://yahoo.com', 'https://bing.com', 'https://www.ecosia.org', 'https://www.wikipedia.org' ] results = [] with

Re: Best way to check if there is internet?

2022-02-08 Thread Alan Bawden
And I missed one that was just published last month: https://datatracker.ietf.org/doc/html/rfc9171 Unlike RFC 5050, this version of the protocol actually claims to be a "Proposed Standard". -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-08 Thread Alan Bawden
Greg Ewing writes: On 8/02/22 8:51 am, Chris Angelico wrote: > Some day, we'll have people on Mars. They won't have TCP connections - > at least, not unless servers start supporting connection timeouts > measured in minutes or hours - but it wouldn't surprise me if some > sort of

Aw: Re: Best way to check if there is internet?

2022-02-07 Thread Karsten Hilbert
> Or the internet acquires a new protocol that's designed > for very-long-latency connections. That's being worked on already https://en.wikipedia.org/wiki/NASA_Deep_Space_Network Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 12:20, Ethan Furman wrote: > > On 2/7/22 4:27 PM, Greg Ewing wrote: > > On 8/02/22 8:51 am, Chris Angelico wrote: > > >> Some day, we'll have people on Mars. They won't have TCP connections - > >> at least, not unless servers start supporting connection timeouts > >>

Re: Best way to check if there is internet?

2022-02-07 Thread Michael Torrie
On 2/7/22 12:51, Chris Angelico wrote: > Some day, we'll have people on Mars. They won't have TCP connections - > at least, not unless servers start supporting connection timeouts > measured in minutes or hours - but it wouldn't surprise me if some > sort of caching proxy system is deployed. > >

Re: Best way to check if there is internet?

2022-02-07 Thread Ethan Furman
On 2/7/22 4:27 PM, Greg Ewing wrote: > On 8/02/22 8:51 am, Chris Angelico wrote: >> Some day, we'll have people on Mars. They won't have TCP connections - >> at least, not unless servers start supporting connection timeouts >> measured in minutes or hours - but it wouldn't surprise me if some >>

Re: Best way to check if there is internet?

2022-02-07 Thread Greg Ewing
On 8/02/22 8:51 am, Chris Angelico wrote: Some day, we'll have people on Mars. They won't have TCP connections - at least, not unless servers start supporting connection timeouts measured in minutes or hours - but it wouldn't surprise me if some sort of caching proxy system is deployed. Or the

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 09:31, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-02-08 at 06:51:20 +1100, > Chris Angelico wrote: > > > Either way, though: would a person on Mars "have the internet"? Yes, > > but not the internet as we know it... > > By current definition, they *can't* have

Re: Best way to check if there is internet?

2022-02-07 Thread 2QdxY4RzWzUUiLuE
On 2022-02-08 at 06:51:20 +1100, Chris Angelico wrote: > Either way, though: would a person on Mars "have the internet"? Yes, > but not the internet as we know it... By current definition, they *can't* have the internet as we know it. Wikipedia,¹ Mirrian-Webster,² and TechTerms.com³ (the first

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 08:30, Cameron Simpson wrote: > > On 08Feb2022 06:51, Chris Angelico wrote: > >Some day, we'll have people on Mars. They won't have TCP connections - > >at least, not unless servers start supporting connection timeouts > >measured in minutes or hours - but it wouldn't

Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 08Feb2022 06:51, Chris Angelico wrote: >Some day, we'll have people on Mars. They won't have TCP connections - >at least, not unless servers start supporting connection timeouts >measured in minutes or hours - but it wouldn't surprise me if some >sort of caching proxy system is deployed. The

Re: Best way to check if there is internet?

2022-02-07 Thread Cameron Simpson
On 07Feb2022 11:40, Grant Edwards wrote: >Ah, c'mon... Every geek worth his salt knows a few real world IP >addresses without relying on DNS. If you want to "ping Google", it's > $ ping 8.8.8.8 > $ ping 8.8.4.4 And Cloudflare is 1.1.1.1. Speaking as someone who's seen his upstream provider have

Re: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber wrote: > On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards > declaimed the following: > >>On 2022-02-07, Dennis Lee Bieber wrote: >> >>> Also, for a machine freshly booted, with no cache, even pinging >>> Google first requires making contact with a DNS

Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards declaimed the following: >On 2022-02-07, Dennis Lee Bieber wrote: > >> Also, for a machine freshly booted, with no cache, even pinging >> Google first requires making contact with a DNS server to ask for >> Google's IP address. With no

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Tue, 8 Feb 2022 at 06:41, Grant Edwards wrote: > But, as has been pointed out previously "if there is internet" is too > vague a question to have an answer. > > If all you have is proxied access to outside HTTPS servers, then I > would consider the answer to be "no", but most people would say

Re: Best way to check if there is internet?

2022-02-07 Thread Grant Edwards
On 2022-02-07, Dennis Lee Bieber wrote: > Also, for a machine freshly booted, with no cache, even pinging > Google first requires making contact with a DNS server to ask for > Google's IP address. With no network, the DNS look-up will fail > before ping even tries to hit Google. Ah, c'mon...

Re: Best way to check if there is internet?

2022-02-07 Thread Dennis Lee Bieber
On Mon, 7 Feb 2022 13:33:54 +0400, Abdur-Rahmaan Janhangeer declaimed the following: >Popular browsers tell: No internet connection detected. A function that >goes in the same sense. Unless they too are pinging Google.com to check ... > Ah, but WHEN do those browsers report that? When

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Mon, 7 Feb 2022 at 23:48, Lars Liedtke wrote: > > Each Browser is doing it differently and even Windows or > Linux-Desktopmanagers (NetworkManager). > > I have had cases, where one tool told me I had Internet and another one > I hadn't. Not at all surprised :) Though that situation would

Re: Best way to check if there is internet?

2022-02-07 Thread Lars Liedtke
tandard library or 3rd party libraries, what's the best way to check if there is internet? Checking if google.com is reachable is good but I wonder if there is a more native, protocol-oriented way of knowing? What do you mean by "if there is internet"? How low a level of connection do

Re: Best way to check if there is internet?

2022-02-07 Thread Lars Liedtke
On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer wrote: Greetings, Using the standard library or 3rd party libraries, what's the best way to check if there is internet? Checking if google.com is reachable is good but I wonder if there is a more native, protocol-oriented way of

Re: Best way to check if there is internet?

2022-02-07 Thread Abdur-Rahmaan Janhangeer
ps://github.com/Abdur-RahmaanJ> Mauritius On Mon, Feb 7, 2022 at 1:28 PM Chris Angelico wrote: > On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer > wrote: > > > > Greetings, > > > > Using the standard library or 3rd party libraries, what's the >

Re: Best way to check if there is internet?

2022-02-07 Thread Chris Angelico
On Mon, 7 Feb 2022 at 20:18, Abdur-Rahmaan Janhangeer wrote: > > Greetings, > > Using the standard library or 3rd party libraries, what's the > best way to check if there is internet? Checking if google.com > is reachable is good but I wonder if there is a more native, > pr

Best way to check if there is internet?

2022-02-07 Thread Abdur-Rahmaan Janhangeer
Greetings, Using the standard library or 3rd party libraries, what's the best way to check if there is internet? Checking if google.com is reachable is good but I wonder if there is a more native, protocol-oriented way of knowing? Even this URL recommends checking if a domain is up as a way