feat: reintroduce the tproxy functionality (#975)
We originally removed the TProxy in https://github.com/ooni/probe/issues/2224. Nevertheless, in https://github.com/ooni/probe-cli/pull/969, we determined that something like the previous TProxy, with small changes, was required to support https://github.com/ooni/probe/issues/2340. So, this pull request reintroduces a slightly-modified TProxy functionality that better adapts to the `--remote=REMOTE` use case.
This commit is contained in:
parent
46233802ab
commit
86ffd6a0c4
10 changed files with 262 additions and 55 deletions
|
|
@ -83,8 +83,8 @@ func TestNewDialer(t *testing.T) {
|
|||
func TestDialerSystem(t *testing.T) {
|
||||
t.Run("has a default timeout", func(t *testing.T) {
|
||||
d := &DialerSystem{}
|
||||
ud := d.newUnderlyingDialer()
|
||||
if ud.(*net.Dialer).Timeout != dialerDefaultTimeout {
|
||||
timeout := d.configuredTimeout()
|
||||
if timeout != dialerDefaultTimeout {
|
||||
t.Fatal("unexpected default timeout")
|
||||
}
|
||||
})
|
||||
|
|
@ -92,8 +92,8 @@ func TestDialerSystem(t *testing.T) {
|
|||
t.Run("we can change the timeout for testing", func(t *testing.T) {
|
||||
const smaller = 1 * time.Second
|
||||
d := &DialerSystem{timeout: smaller}
|
||||
ud := d.newUnderlyingDialer()
|
||||
if ud.(*net.Dialer).Timeout != smaller {
|
||||
timeout := d.configuredTimeout()
|
||||
if timeout != smaller {
|
||||
t.Fatal("unexpected timeout")
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue