Feature: filter by hostname for Mullvad servers

This commit is contained in:
Quentin McGaw
2021-05-08 19:17:36 +00:00
parent a34769ae02
commit 2ec2f45c82
11 changed files with 382 additions and 143 deletions

View File

@@ -16,6 +16,10 @@ func (settings *Provider) mullvadLines() (lines []string) {
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
}
if len(settings.ServerSelection.Hostnames) > 0 {
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
}
if len(settings.ServerSelection.ISPs) > 0 {
lines = append(lines, lastIndent+"ISPs: "+commaJoin(settings.ServerSelection.ISPs))
}
@@ -54,6 +58,11 @@ func (settings *Provider) readMullvad(r reader) (err error) {
return err
}
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.MullvadHostnameChoices())
if err != nil {
return err
}
settings.ServerSelection.ISPs, err = r.env.CSVInside("ISP", constants.MullvadISPChoices())
if err != nil {
return err