dewey/WhatStatus — pull request #2 by jimrollenhagen (2014-10-06 17:38:34+00:00)
Title: Check all available tracker proxies

tracker.what.cd resolves to many IP addresses, each of which is a
proxy to the actual tracker. Any of these proxies could individually
be down, causing intermittent errors connecting to the tracker.

Adds code to check every proxy, and a constant to tune how many
proxies should be allowed to be down. If more than the allowed
number of proxies are down, show tracker as down.

It might be interesting to improve this later to actually show
how many proxies are up; however I think this will encourage people
to put an individual tracker proxy in a hostsfile or something,
causing problems later. I think just an up/down is the way to go
here.

I'm also curious how the DNS module handles caching, etc. If
proxy IPs change and the lookups are cached hard, things may fail
in strange ways. The `resolve4()` function used here appears to use
C-Ares under the hood[1]. Might be worth looking into.

[1] http://nodejs.org/api/dns.html#dns_dns