ooni-probe-cli/internal/engine/experiment
Simone Basso c2ea0b4704
feat(webconnectivity): try all the available THs (#980)
We introduce a fork of internal/httpx, named internal/httpapi, where there is a clear split between the concept of an API endpoint (such as https://0.th.ooni.org/) and of an API descriptor (such as using `GET` to access /api/v1/test-list/url).

Additionally, httpapi allows to create a SequenceCaller that tries to call a given API descriptor using multiple API endpoints. The SequenceCaller will stop once an endpoint works or when all the available endpoints have been tried unsuccessfully.

The definition of "success" is the following: we consider "failure" any error that occurs during the HTTP round trip or when reading the response body. We DO NOT consider "failure" errors (1) when parsing the input URL; (2) when the server returns >= 400; (3) when the server returns a string that does not parse as valid JSON. The idea of this classification of failures is that we ONLY want to retry when we see what looks like a network error that may be caused by (collateral or targeted) censorship.

We take advantage of the availability of this new package and we refactor web_connectivity@v0.4 and web_connectivity@v0.5 to use a SequenceCaller for calling the web connectivity TH API. This means that we will now try all the available THs advertised by the backend rather than just selecting and using the first one provided by the backend.

Because this diff is designed to be backported to the `release/3.16` branch, we have omitted additional changes to always use httpapi where we are currently using httpx. Yet, to remind ourselves about the need to do that, we have deprecated the httpx package. We will rewrite all the code currently using httpx to use httpapi as part of future work.

It is also worth noting that httpapi will allow us to refactor the backend code such that (1) we remove code to select a backend URL endpoint at the beginning and (2) we try several endpoints. The design of the code is such that we can add to the mix some endpoints using as `http.Client` a special client using a tunnel. This will allow us to automatically fallback backend queries.

Closes https://github.com/ooni/probe/issues/2353.

Related to https://github.com/ooni/probe/issues/1519.
2022-11-21 16:28:53 +01:00
..
dash cleanup(netx): remove redundant config options (#791) 2022-06-02 18:18:49 +02:00
dnscheck fix(dnscheck): record whether residual is enabled (#922) 2022-09-02 13:31:24 +02:00
dnsping feat: record delayed DNS responses in dnsping (#878) 2022-08-25 13:59:24 +02:00
example feat: introduce the tcpping experiment (#696) 2022-05-09 09:33:18 +02:00
fbmessenger refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
hhfm refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
hirl refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
httphostheader feat: introduce the tcpping experiment (#696) 2022-05-09 09:33:18 +02:00
ndt7 cleanup: netx does not use netxlite legacy names (#801) 2022-06-06 14:46:44 +02:00
portfiltering feat: port-filtering experiment (#891) 2022-09-14 19:54:43 +02:00
psiphon feat: introduce the tcpping experiment (#696) 2022-05-09 09:33:18 +02:00
quicping cleanup: remove UnderlyingNetworkLibrary and TProxy (#874) 2022-08-23 11:43:44 +02:00
riseupvpn refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
run fix: ensure experiments return nil when we want to submit (#654) 2022-01-07 13:17:20 +01:00
signal Fix the signal root CA (#978) 2022-10-31 17:30:12 +01:00
simplequicping chore: upgrade deps and attempt to enable using go1.19 (#869) 2022-08-19 11:26:50 +02:00
sniblocking netxlite: call getaddrinfo and handle platform-specific oddities (#764) 2022-05-28 15:10:30 +02:00
stunreachability [forwardport] fix(stunreachability): don't emit spurious progress events (#803) 2022-06-06 16:21:17 +02:00
tcpping refactor(measurexlite): make buffered channels private (#864) 2022-08-17 20:10:48 +02:00
telegram feat: introduce the tcpping experiment (#696) 2022-05-09 09:33:18 +02:00
tlsmiddlebox feat: tlsmiddlebox experiment (#817) 2022-09-08 17:31:03 +02:00
tlsping refactor: allow automatically wrap net/quic conn (#867) 2022-08-17 20:58:06 +02:00
tlstool refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
tor refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
torsf refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
urlgetter fix: disable psiphon when building with go1.19 (#871) 2022-08-22 11:50:58 +02:00
vanillator refactor: move tracex outside of engine/netx (#782) 2022-06-02 00:50:55 +02:00
webconnectivity feat(webconnectivity): try all the available THs (#980) 2022-11-21 16:28:53 +01:00
whatsapp cleanup: merge httpheader and httpfailure into model (#758) 2022-05-25 09:54:50 +02:00
README.md doc(step-by-step): readability improvements (#820) 2022-06-30 09:55:18 +02:00

Directory github.com/ooni/probe-cli/internal/engine/experiment

This directory contains the implementation of all the supported experiments, one for each directory. The OONI spec repository contains a description of all the specified experiments.

Note that in the OONI spec repository experiments are called nettests. Originally, they were also called nettests here but that created confusion with nettests in ooni/probe-cli. Therefore, we now use the term experiment to indicate the implementation and the term nettest to indicate the user facing view of such implementation.

Note that some experiments implemented here are not part of the OONI specification. For example, the urlgetter experiment is not in the OONI spec repository. The reason why this happens is that urlgetter is an experiment "library" that other experiments use to implement their functionality.

Likewise, the example experiment is a minimal experiment that does nothing and you could use to bootstrap the implementation of a new experiment. Of course, this experiment is not part of the OONI specification.