2021-12-15 14:16:22 +01:00
|
|
|
//go:build ios || android
|
|
|
|
|
|
|
|
package tunnel
|
|
|
|
|
|
|
|
// This file implements our strategy for running tor on mobile.
|
|
|
|
|
|
|
|
import (
|
2022-01-25 20:43:27 +01:00
|
|
|
"strings"
|
|
|
|
|
2021-12-15 14:16:22 +01:00
|
|
|
"github.com/cretz/bine/tor"
|
|
|
|
"github.com/ooni/go-libtor"
|
|
|
|
)
|
|
|
|
|
|
|
|
// getTorStartConf in this configuration uses github.com/ooni/go-libtor.
|
|
|
|
func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.StartConf, error) {
|
2022-01-25 20:43:27 +01:00
|
|
|
config.logger().Infof("tunnel: tor: exec: <ooni/go-libtor> %s %s",
|
|
|
|
dataDir, strings.Join(extraArgs, " "))
|
2021-12-15 14:16:22 +01:00
|
|
|
return &tor.StartConf{
|
|
|
|
ProcessCreator: libtor.Creator,
|
|
|
|
DataDir: dataDir,
|
|
|
|
ExtraArgs: extraArgs,
|
|
|
|
NoHush: true,
|
|
|
|
}, nil
|
|
|
|
}
|