refactor(netxlite): expose useful HTTPTransport/DNSTransport factories (#813)

These factories will soon be useful to finish with
https://github.com/ooni/probe/issues/2135.
This commit is contained in:
Simone Basso 2022-06-09 00:30:18 +02:00 committed by GitHub
commit 1685ef75b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 224 additions and 30 deletions

View file

@ -29,8 +29,7 @@ func init() {
// puzzling https://github.com/ooni/probe/issues/1409 issue.
const resolverURL = "https://8.8.8.8/dns-query"
resolver = netxlite.NewParallelDNSOverHTTPSResolver(log.Log, resolverURL)
txp := netxlite.NewHTTPTransportWithResolver(log.Log, resolver)
httpClient = netxlite.NewHTTPClient(txp)
httpClient = netxlite.NewHTTPClientWithResolver(log.Log, resolver)
}
func main() {