feat(miniooni): implement torsf tunnel (#921)
This diff adds to miniooni support for using the torsf tunnel. Such a tunnel consists of a snowflake pluggable transport in front of a custom instance of tor and requires tor to be installed. The usage is like: ``` ./miniooni --tunnel=torsf [...] ``` The default snowflake rendezvous method is "domain_fronting". You can select the AMP cache instead using "amp": ``` ./miniooni --snowflake-rendezvous=amp --tunnel=torsf [...] ``` Part of https://github.com/ooni/probe/issues/1955
This commit is contained in:
parent
5466f30526
commit
18a9523496
10 changed files with 438 additions and 57 deletions
|
|
@ -35,6 +35,10 @@ type SessionConfig struct {
|
|||
TorArgs []string
|
||||
TorBinary string
|
||||
|
||||
// SnowflakeRendezvous is the rendezvous method
|
||||
// to be used by the torsf tunnel
|
||||
SnowflakeRendezvous string
|
||||
|
||||
// TunnelDir is the directory where we should store
|
||||
// the state of persistent tunnels. This field is
|
||||
// optional _unless_ you want to use tunnels. In such
|
||||
|
|
@ -171,16 +175,17 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
|
|||
proxyURL := config.ProxyURL
|
||||
if proxyURL != nil {
|
||||
switch proxyURL.Scheme {
|
||||
case "psiphon", "tor", "fake":
|
||||
case "psiphon", "tor", "torsf", "fake":
|
||||
config.Logger.Infof(
|
||||
"starting '%s' tunnel; please be patient...", proxyURL.Scheme)
|
||||
tunnel, _, err := tunnel.Start(ctx, &tunnel.Config{
|
||||
Logger: config.Logger,
|
||||
Name: proxyURL.Scheme,
|
||||
Session: &sessionTunnelEarlySession{},
|
||||
TorArgs: config.TorArgs,
|
||||
TorBinary: config.TorBinary,
|
||||
TunnelDir: config.TunnelDir,
|
||||
Logger: config.Logger,
|
||||
Name: proxyURL.Scheme,
|
||||
SnowflakeRendezvous: config.SnowflakeRendezvous,
|
||||
Session: &sessionTunnelEarlySession{},
|
||||
TorArgs: config.TorArgs,
|
||||
TorBinary: config.TorBinary,
|
||||
TunnelDir: config.TunnelDir,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Reference in a new issue