• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ooni / probe-cli / 6198965727
72%

Build:
DEFAULT BRANCH: master
Ran 15 Sep 2023 02:01PM UTC
Jobs 1
Files 494
Run time 14s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Sep 2023 01:56PM UTC coverage: 80.55% (-0.5%) from 81.046%
6198965727

push

github

web-flow
feat(testingx): introduce more comprehensive HTTP(S) proxy (#1274)

We want more comprehensive testing of how we use proxies during the
bootstrap. Tests should encompass both SOCKS5 and HTTP(S) proxies. Tests
should support using both the host network and using netem.

This diff starts paving the way for improving proxy testing, by
introducing in `./internal/testingx/httpproxy.go` an HTTP(S) proxy
implementation supporting both the case of HTTP over HTTP(S) proxy
(where you use the host header) and HTTPS over HTTP(S) proxy (where the
client issues a `CONNECT` request to the remote endpoint).

The previous implementation (in `./internal/testingx/httptestx.go`) is
still there, for now. We used the previous implementation, which only
supported the host header, as a starting point for writing the new one.

More in detail, this diff introduces the new proxy and its tests.
Because testing the proxy functionality is a bit complex, I chose to use
a separate package and also write tests for the tests. Obviously, we're
still using `netxlite` as the underlying library, so there is some
circularity in testing, but `netxlite` also has its own tests, so we
should probably be fine.

The separate package with tests is `./internal/testingproxy`.

While working on this package, I realized the need to forward the CA
used by the proxy. This happens in
`./internal/testingproxy/hosthttps.go`. If we do not do this, we see the
following failure:

```
=== RUN   TestWorkingAsIntended/fetching_https://www.example.com/_using_the_host_network_and_an_HTTPS_proxy
2023/09/15 15:28:39 debug > GET https://www.example.com/
2023/09/15 15:28:39 debug >                        

2023/09/15 15:28:39 dialerWithAssertions: verified that the network is tcp as expected
2023/09/15 15:28:39 dialerWithAssertions: verified that the address is 127.0.0.1 as expected

2023/09/15 15:28:39 debug dial 127.0.0.1:61772/tcp...
2023/09/15 15:28:39 debug dial_address 127.0... (continued)

36 of 216 new or added lines in 7 files covered. (16.67%)

8 existing lines in 2 files now uncovered.

22438 of 27856 relevant lines covered (80.55%)

27.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 0 - 6198965727.1 15 Sep 2023 02:01PM UTC 0
80.55
GitHub Action Run
Source Files on build 6198965727
Detailed source file information is not available for this build.
  • Back to Repo
  • 829b1b01 on github
  • Prev Build on master (#6198299156)
  • Next Build on master (#6199494172)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc