feat: tlsmiddlebox experiment (#817)
See https://github.com/ooni/probe/issues/2124
This commit is contained in:
parent
b78b9aca51
commit
f2b88ddb4a
24 changed files with 1670 additions and 0 deletions
25
internal/engine/experiment/tlsmiddlebox/utils.go
Normal file
25
internal/engine/experiment/tlsmiddlebox/utils.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package tlsmiddlebox
|
||||
|
||||
//
|
||||
// Utility functions for tlsmiddlebox
|
||||
//
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
// prepareAddrs prepares the resolved IP addresses by
|
||||
// adding the configured port as a prefix
|
||||
func prepareAddrs(addrs []string, port string) (out []string) {
|
||||
if port == "" {
|
||||
port = "443"
|
||||
}
|
||||
for _, addr := range addrs {
|
||||
if net.ParseIP(addr) == nil {
|
||||
continue
|
||||
}
|
||||
addr = net.JoinHostPort(addr, port)
|
||||
out = append(out, addr)
|
||||
}
|
||||
return
|
||||
}
|
||||
Loading…
Reference in a new issue