Feature: Filter VyprVPN servers by hostname, and:

- Extract if server supports TCP and UDP (never TCP now)
- Filter servers by protocol (unused for now)
This commit is contained in:
Quentin McGaw
2021-05-10 02:12:13 +00:00
parent 95b0fb81d6
commit 2d95edf8ab
7 changed files with 110 additions and 87 deletions

View File

@@ -46,13 +46,21 @@ func GetServers(ctx context.Context, unzipper unzip.Unzipper,
continue
}
tcp, udp, err := openvpn.ExtractProto(content)
if err != nil {
// treat error as warning and go to next file
warning := err.Error() + " in " + fileName
warnings = append(warnings, warning)
continue
}
region, err := parseFilename(fileName)
if err != nil {
warnings = append(warnings, err.Error())
continue
}
hts.add(host, region)
hts.add(host, region, tcp, udp)
}
if len(hts) < minServers {