MCPcopy Create free account
hub / github.com/Licoy/fetch-github-hosts / fetch_hosts

Function fetch_hosts

src-tauri/src/dns.rs:26–34  ·  view source on GitHub ↗

Resolve all GitHub domains and return (ip, domain) pairs

(domains: &[String])

Source from the content-addressed store, hash-verified

24
25/// Resolve all GitHub domains and return (ip, domain) pairs
26pub fn fetch_hosts(domains: &[String]) -> Vec<(String, String)> {
27 let mut hosts = Vec::new();
28 for domain in domains {
29 if let Some(ip) = resolve_ipv4(domain) {
30 hosts.push((ip, domain.clone()));
31 }
32 }
33 hosts
34}
35
36/// Format hosts entries into a text string
37pub fn format_hosts_text(hosts: &[(String, String)], now: &str) -> String {

Callers 1

server_fetch_hostsFunction · 0.85

Calls 1

resolve_ipv4Function · 0.85

Tested by

no test coverage detected