(hostname)
| 159 | |
| 160 | // Resolve hostname to IP so providers requiring a numeric address still work |
| 161 | const resolveHost = async (hostname) => { |
| 162 | try { |
| 163 | return (await dns.lookup(hostname)).address; |
| 164 | } catch (error) { |
| 165 | log.warn(`DNS lookup failed for ${hostname}, falling through with raw host`, error.message); |
| 166 | return hostname; |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | // Resolve geographic info for a host via a chain of providers with country enrichment |
| 171 | const locationHandler = async (url) => { |