|
|
|
|
|
by OskarS
2582 days ago
|
|
So... the test is "can I connect to either the website icanhazip.com or OpenDNS". With the IPv4 addresses of both burned into the code. So this depends on two external servers never going down and not ever changing IP addresses, one of which is pretty sketchy ("icanhazip.com", seriously?), and it wouldn't work AT ALL in an IPv6-only environment (which I grant is rather unlikely at the moment, but might not be in the future). I like Rust a lot, but micro-packages like these are giving me real bad "left-pad" vibes. |
|
The actually meaningful question you almost always want answered instead of "am I online?" is "will I be able to connect to X host?" The obvious check is to try to connect to that host.