feat: introduce the tlsping experiment (#716)

See https://github.com/ooni/probe/issues/2088 (issue) and https://github.com/ooni/spec/pull/236 (spec).
This commit is contained in:
Simone Basso
2022-05-09 10:25:50 +02:00
committed by GitHub
parent e983a5cffb
commit 2917dd6c76
4 changed files with 323 additions and 0 deletions
@@ -135,6 +135,7 @@ func (m *Measurer) tcpPingAsync(ctx context.Context, mxmx *measurex.Measurer,
// tcpConnect performs a TCP connect and returns the result to the caller.
func (m *Measurer) tcpConnect(ctx context.Context, mxmx *measurex.Measurer,
address string) *measurex.EndpointMeasurement {
// TODO(bassosimone): make the timeout user-configurable
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
defer cancel()
return mxmx.TCPConnect(ctx, address)