Skip to content

Commit

Permalink
fix(engineresolver): support HTTP/HTTPS proxies (#1353)
Browse files Browse the repository at this point in the history
By using netxlite.NewHTTPTransportWithOptions in
`./internal/engineresolver/factory.go`:

1. we remove an unnecessary usage of the quirky HTTP transport used for
measuring by ./legacy/netx et al (removing such unnecessary usages is
ooni/probe#2534);

2. we enable using HTTP/HTTPS proxies in miniooni and ooniprobe.

Closes ooni/probe#1955.
  • Loading branch information
bassosimone authored Oct 9, 2023
1 parent 2edeafa commit a694f7f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/engineresolver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ func newChildResolverHTTPS(
var txp model.HTTPTransport
switch http3Enabled {
case false:
dialer := netxlite.MaybeWrapWithProxyDialer(
netxlite.NewDialerWithStdlibResolver(logger),
proxyURL, // handles correctly the case where proxyURL is nil
)
dialer := netxlite.NewDialerWithStdlibResolver(logger)
thx := netxlite.NewTLSHandshakerStdlib(logger)
tlsDialer := netxlite.NewTLSDialer(dialer, thx)
// TODO(https://github.com/ooni/probe/issues/2534): here we're using the QUIRKY netxlite.NewHTTPTransport
// function, but we can probably avoid using it, given that this code is
// not using tracing and does not care about those quirks.
txp = netxlite.NewHTTPTransport(logger, dialer, tlsDialer)
txp = netxlite.NewHTTPTransportWithOptions(
logger, dialer, tlsDialer,
netxlite.HTTPTransportOptionDisableCompression(false), // defaults to true but compression is fine here
netxlite.HTTPTransportOptionProxyURL(proxyURL), // nil here disables using the proxy
)
case true:
txp = netxlite.NewHTTP3TransportStdlib(logger)
}
Expand Down

0 comments on commit a694f7f

Please sign in to comment.