diff --git a/internal/experiment/torsf/torsf.go b/internal/experiment/torsf/torsf.go index c209dbc8b..835f20753 100644 --- a/internal/experiment/torsf/torsf.go +++ b/internal/experiment/torsf/torsf.go @@ -37,9 +37,6 @@ type Config struct { // RendezvousMethod allows to choose the method with which to rendezvous. RendezvousMethod string `ooni:"Choose the method with which to rendezvous. Must be one of amp and domain_fronting. Leaving this field empty means we should use the default."` - - BrokerURL string `ooni:"TODO"` - FrontDomain string `ooni:"TODO"` } // TestKeys contains the experiment's result. @@ -179,11 +176,6 @@ func (m *Measurer) setup(ctx context.Context, // cannot run the experiment with unknown rendezvous method return nil, nil, err } - if rm.Name() == "domain_fronting" { - t1 := rm.(*ptx.SnowflakeRendezvousMethodDomainFronting) - t1.URL = m.config.BrokerURL - t1.Front = m.config.FrontDomain - } sfdialer := ptx.NewSnowflakeDialerWithRendezvousMethod(rm) ptl := &ptx.Listener{ ExperimentByteCounter: bytecounter.ContextExperimentByteCounter(ctx), diff --git a/internal/ptx/snowflake.go b/internal/ptx/snowflake.go index 766acd848..a48883f58 100644 --- a/internal/ptx/snowflake.go +++ b/internal/ptx/snowflake.go @@ -27,36 +27,25 @@ type SnowflakeRendezvousMethod interface { // NewSnowflakeRendezvousMethodDomainFronting is a rendezvous method // that uses domain fronting to perform the rendezvous. func NewSnowflakeRendezvousMethodDomainFronting() SnowflakeRendezvousMethod { - return &SnowflakeRendezvousMethodDomainFronting{} + return &snowflakeRendezvousMethodDomainFronting{} } -type SnowflakeRendezvousMethodDomainFronting struct { - URL string - Front string -} +type snowflakeRendezvousMethodDomainFronting struct{} -func (d *SnowflakeRendezvousMethodDomainFronting) Name() string { +func (d *snowflakeRendezvousMethodDomainFronting) Name() string { return "domain_fronting" } -func (d *SnowflakeRendezvousMethodDomainFronting) AMPCacheURL() string { +func (d *snowflakeRendezvousMethodDomainFronting) AMPCacheURL() string { return "" } -func (d *SnowflakeRendezvousMethodDomainFronting) BrokerURL() string { - if d.URL != "" { - return d.URL - } else { - return "https://1098762253.rsc.cdn77.org/" - } +func (d *snowflakeRendezvousMethodDomainFronting) BrokerURL() string { + return "https://1098762253.rsc.cdn77.org/" } -func (d *SnowflakeRendezvousMethodDomainFronting) FrontDomain() string { - if d.Front != "" { - return d.Front - } else { - return "www.phpmyadmin.net" - } +func (d *snowflakeRendezvousMethodDomainFronting) FrontDomain() string { + return "www.phpmyadmin.net" } // NewSnowflakeRendezvousMethodAMP is a rendezvous method that diff --git a/internal/ptx/snowflake_test.go b/internal/ptx/snowflake_test.go index 68254dec5..c0e780281 100644 --- a/internal/ptx/snowflake_test.go +++ b/internal/ptx/snowflake_test.go @@ -54,7 +54,7 @@ func TestNewSnowflakeRendezvousMethod(t *testing.T) { if err != nil { t.Fatal(err) } - if _, ok := meth.(*SnowflakeRendezvousMethodDomainFronting); !ok { + if _, ok := meth.(*snowflakeRendezvousMethodDomainFronting); !ok { t.Fatal("unexpected method type") } }) @@ -64,7 +64,7 @@ func TestNewSnowflakeRendezvousMethod(t *testing.T) { if err != nil { t.Fatal(err) } - if _, ok := meth.(*SnowflakeRendezvousMethodDomainFronting); !ok { + if _, ok := meth.(*snowflakeRendezvousMethodDomainFronting); !ok { t.Fatal("unexpected method type") } }) @@ -92,7 +92,7 @@ func TestNewSnowflakeRendezvousMethod(t *testing.T) { func TestNewSnowflakeDialer(t *testing.T) { dialer := NewSnowflakeDialer() - _, ok := dialer.RendezvousMethod.(*SnowflakeRendezvousMethodDomainFronting) + _, ok := dialer.RendezvousMethod.(*snowflakeRendezvousMethodDomainFronting) if !ok { t.Fatal("invalid rendezvous method type") }