Hacker News new | ask | show | jobs
by TD-Linux 2584 days ago
There are a lot better websites to ping for this, that are used for captive portal detection. E.g. Chromium uses http://clients3.google.com/generate_204 and Firefox uses http://detectportal.firefox.com/success.txt.
2 comments

Am I right in thinking that either of those pages going down would result in "Sign in to your network" dialogs being shown in every single instance of their respective browsers? That's crazy.

I mean I know this is google we're talking about, their uptime is second-to-none, but that still seems like a hell of a dependency.

I doubt it. I think these are for detecting whether or not you're in a "captive portal". I.e. airport wifi that requires you to enter login credentials or something.

But hey, give it a whirl: block detectportal.firefox.com with your hosts file and see what happens.

I gave it a try, I didn't see any difference.
No it does not. It will only show that dialog if the page returns anything different than the expected response, exactly like a captive portal would.
That could even be used to return an enum instead of bool: Online, CaptivePortal with the URL as member and Offline.