Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Oct 17, 2024
1 parent ec9a637 commit 1b70367
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions internal/experiment/openvpn/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import (

// defaultOONIEndpoints is the array of hostnames that will return valid
// endpoints to be probed. Do note that this is a workaround for the lack
// of a backend service.
// of a backend service; if you maintain this experiment in the future please
// feel free to remove this workaround after the probe-services for distributing
// endpoints has been deployed to production.
var defaultOONIEndpoints = []string{
"a.composer-presenter.com",
"a.goodyear2dumpster.com",
Expand Down Expand Up @@ -96,35 +98,38 @@ func resolveOONIAddresses(logger model.Logger) ([]string, error) {
return valid, nil
}

// pickOONIOpenVPNTargets returns an array of input URIs from the list of available endpoints, up to max,
// for the given transport. By default, we use the first endpoint that resolves to an IP. If reverseOrder
// is specified, we reverse the list before attempting resolution.
// pickOONIOpenVPNTargets crafts targets from the passed array of IP addresses.
func pickOONIOpenVPNTargets(ipaddrList []string) ([]string, error) {

// Step 1. Create endpoint list.

endpoints := []endpoint{}
for _, ipAddr := range ipaddrList {
// 1. Probe the canonical 1194/udp and 1194/tcp ports
for _, ipaddr := range ipaddrList {

// Probe the canonical 1194/udp and 1194/tcp ports

endpoints = append(endpoints, endpoint{
Obfuscation: "none",
Port: "1194",
Protocol: "openvpn",
Provider: "oonivpn",
IPAddr: ipAddr,
IPAddr: ipaddr,
Transport: "tcp",
})
endpoints = append(endpoints, endpoint{
Obfuscation: "none",
Port: "1194",
Protocol: "openvpn",
Provider: "oonivpn",
IPAddr: ipAddr,
IPAddr: ipaddr,
Transport: "udp",
})

}

// Pick one IP and sample on non-standard ports
// to confirm if this one goes through.
// Pick one IP from the list and sample on non-standard ports
// to check if the standard port was filtered.

extra := ipaddrList[rand.Intn(len(ipaddrList))]
endpoints = append(endpoints, endpoint{
Obfuscation: "none",
Expand All @@ -144,6 +149,7 @@ func pickOONIOpenVPNTargets(ipaddrList []string) ([]string, error) {
})

// Step 2. Create targets for the selected endpoints.

targets := make([]string, 0)
for _, e := range endpoints {
targets = append(targets, e.AsInputURI())
Expand Down

0 comments on commit 1b70367

Please sign in to comment.