refactor(tunnel): simplify tor implementation (#290)

Simplify interaction within the package by avoiding to have
a tor specific config. Use a Config instead.

Part of https://github.com/ooni/probe/issues/985.
This commit is contained in:
Simone Basso 2021-04-03 21:25:08 +02:00 committed by GitHub
commit d9aff19be5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 109 additions and 92 deletions

View file

@ -13,10 +13,14 @@ import (
// psiphonTunnel is a psiphon tunnel
type psiphonTunnel struct {
tunnel *clientlib.PsiphonTunnel
// tunnel is the underlying psiphon tunnel
tunnel *clientlib.PsiphonTunnel
// duration is the duration of the bootstrap
duration time.Duration
}
// makeworkingdir creates the working directory
func makeworkingdir(config *Config) (string, error) {
const testdirname = "oonipsiphon"
workdir := filepath.Join(config.WorkDir, testdirname)