Skip to content

Commit

Permalink
fix(oohelper): make sure the CI is green (#282)
Browse files Browse the repository at this point in the history
* chore(oohelper): increase tests verbosity

Hopefully this helps with ooni/probe#1409.

* fix(oohelper): use a nonstandard resolver

* fix previous

* make the diff pleasant/committable/correct
  • Loading branch information
bassosimone authored Apr 1, 2021
1 parent 2ca9496 commit 51459e2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions internal/cmd/oohelper/oohelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ var (
target = flag.String("target", "", "Target URL for the test helper")
)

func newhttpclient() *http.Client {
// Use a nonstandard resolver, which is enough to work around the
// puzzling https://github.com/ooni/probe/issues/1409 issue.
childResolver, err := netx.NewDNSClient(
netx.Config{Logger: log.Log}, "dot://8.8.8.8:853")
runtimex.PanicOnError(err, "netx.NewDNSClient should not fail here")
txp := netx.NewHTTPTransport(netx.Config{
BaseResolver: childResolver,
Logger: log.Log,
})
return &http.Client{Transport: txp}
}

func init() {
txp := netx.NewHTTPTransport(netx.Config{Logger: log.Log})
httpClient = &http.Client{Transport: txp}
httpClient = newhttpclient()
resolver = netx.NewResolver(netx.Config{Logger: log.Log})
}

Expand Down

0 comments on commit 51459e2

Please sign in to comment.