Skip to content

Commit

Permalink
hostsgen: provider
Browse files Browse the repository at this point in the history
  • Loading branch information
stackinspector committed Oct 23, 2024
1 parent b211b09 commit 648e05f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hostsgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ struct DnsAnswer {
}

fn main() {
// cargo run --release --bin hostsgen -- 1.0.0.1 hosts-list hosts
let mut args = std::env::args_os();
let _ = args.next();
let provider = args.next().unwrap().into_string().unwrap();
let mut list = io::BufReader::new(fs::File::open(args.next().unwrap()).unwrap());
let dst = args.next();
let mut dst_h: Box<dyn io::Write> = if let Some(dst_path) = dst {
Box::new(fs::OpenOptions::new().create_new(true).write(true).open(&dst_path).unwrap())
} else {
Box::new(io::stdout().lock())
};
let url_prefix = "https://1.1.1.1/dns-query?name=";
let url_prefix = format!("https://{provider}/dns-query?name=");
let mut url_buf = String::with_capacity(url_prefix.len());
loop {
url_buf.clear();
Expand Down

0 comments on commit 648e05f

Please sign in to comment.