use std::collections::HashSet;
use once_cell::sync::Lazy;
static DOMAINS: Lazy<HashSet<String>> = Lazy::new(|| {
let ss = include_str!("china-domains.txt");
ss.split_ascii_whitespace()
.filter(|v| v.len() > 1)
.map(|v| v.to_string())
.collect()
});
pub fn is_chinese_host(host: &str) -> bool {
let exploded: Vec<_> = host.split('.').collect();
for i in 0..exploded.len() {
let candidate = (exploded[i..]).join(".");
if DOMAINS.contains(&candidate) {
return true;
}
}
false
}