184 lines
3.3 KiB
Go
184 lines
3.3 KiB
Go
package main
|
|
|
|
// get https://www.expressvpn.com/vpn-server
|
|
// remove everyting starting with >
|
|
// remove until "Not supported" and after What the green checks mean
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
type ExpressVPN struct {
|
|
}
|
|
|
|
func (s *ExpressVPN) ServerList() (error, *map[string]string) {
|
|
VPNNames := map[string]string{}
|
|
|
|
names := []string{
|
|
"Albania",
|
|
"Algeria",
|
|
"Andorra",
|
|
"Argentina",
|
|
"Armenia",
|
|
"Australia - Brisbane",
|
|
"Australia - Melbourne",
|
|
"Australia - Perth",
|
|
"Australia - Sydney",
|
|
"Australia - Sydney - 2",
|
|
"Austria",
|
|
"Bangladesh",
|
|
"Belarus",
|
|
"Belgium",
|
|
"Bhutan",
|
|
"Bosnia and Herzegovina",
|
|
"Brazil",
|
|
"Brazil - 2",
|
|
"Brunei",
|
|
"Bulgaria",
|
|
"Cambodia",
|
|
"Canada - Montreal",
|
|
"Canada - Toronto",
|
|
"Canada - Toronto - 2",
|
|
"Canada - Vancouver",
|
|
"Chile",
|
|
"Colombia",
|
|
"Costa Rica",
|
|
"Croatia",
|
|
"Cyprus",
|
|
"Czech Republic",
|
|
"Denmark",
|
|
"Ecuador",
|
|
"Egypt",
|
|
"Estonia",
|
|
"Finland",
|
|
"France - Paris - 1",
|
|
"France - Paris - 2",
|
|
"France - Strasbourg",
|
|
"Georgia ",
|
|
"Germany - Frankfurt - 1",
|
|
"Germany - Frankfurt - 2",
|
|
"Germany - Frankfurt - 3",
|
|
"Germany - Nuremberg",
|
|
"Greece",
|
|
"Guatemala",
|
|
"Hong Kong - 1 ",
|
|
"Hong Kong - 2",
|
|
"Hong Kong - 4",
|
|
"Hungary",
|
|
"Iceland",
|
|
"India - Chennai",
|
|
"India - Mumbai - 1",
|
|
"India (via UK)",
|
|
"Indonesia",
|
|
"Ireland",
|
|
"Isle of Man",
|
|
"Israel",
|
|
"Italy - Cosenza",
|
|
"Italy - Milan",
|
|
"Japan - Tokyo",
|
|
"Japan - Tokyo - 2",
|
|
"Jersey",
|
|
"Kazakhstan",
|
|
"Kenya",
|
|
"Kyrgyzstan",
|
|
"Laos",
|
|
"Latvia",
|
|
"Liechtenstein",
|
|
"Lithuania",
|
|
"Luxembourg",
|
|
"Macau",
|
|
"Malaysia",
|
|
"Malta",
|
|
"Mexico",
|
|
"Moldova",
|
|
"Monaco",
|
|
"Mongolia",
|
|
"Montenegro",
|
|
"Myanmar",
|
|
"Nepal",
|
|
"Netherlands - Amsterdam",
|
|
"Netherlands - Amsterdam - 2",
|
|
"Netherlands - Rotterdam",
|
|
"Netherlands - The Hague",
|
|
"New Zealand",
|
|
"North Macedonia",
|
|
"Norway",
|
|
"Pakistan",
|
|
"Panama",
|
|
"Peru",
|
|
"Philippines",
|
|
"Poland",
|
|
"Portugal",
|
|
"Romania",
|
|
"Serbia",
|
|
"Singapore - CBD",
|
|
"Singapore - Jurong",
|
|
"Singapore - Marina Bay",
|
|
"Slovakia",
|
|
"Slovenia",
|
|
"South Africa",
|
|
"South Korea - 2",
|
|
"Spain - Barcelona",
|
|
"Spain - Barcelona - 2",
|
|
"Spain - Madrid",
|
|
"Sri Lanka",
|
|
"Sweden",
|
|
"Sweden - 2",
|
|
"Switzerland",
|
|
"Switzerland - 2",
|
|
"Taiwan - 3",
|
|
"Thailand",
|
|
"Turkey",
|
|
"UK - Docklands",
|
|
"UK - East London",
|
|
"UK - London",
|
|
"Ukraine",
|
|
"Uruguay",
|
|
"USA - Atlanta",
|
|
"USA - Chicago",
|
|
"USA - Dallas",
|
|
"USA - Dallas - 2",
|
|
"USA - Denver",
|
|
"USA - Los Angeles",
|
|
"USA - Los Angeles - 1",
|
|
"USA - Los Angeles - 2",
|
|
"USA - Los Angeles - 3",
|
|
"USA - Los Angeles - 5 ",
|
|
"USA - Miami",
|
|
"USA - Miami - 2",
|
|
"USA - New Jersey - 1",
|
|
"USA - New Jersey - 2",
|
|
"USA - New Jersey - 3",
|
|
"USA - New York",
|
|
"USA - New York - 2",
|
|
"USA - Salt Lake City",
|
|
"USA - San Francisco",
|
|
"USA - Seattle",
|
|
"USA - Tampa - 1",
|
|
"USA - Washington DC",
|
|
"Uzbekistan",
|
|
"Venezuela",
|
|
"Vietnam",
|
|
}
|
|
|
|
for _, entry := range names {
|
|
func(entry string) {
|
|
conv := "%s-ca-version-2.expressnetw.com"
|
|
entry = strings.ToLower(entry)
|
|
entry = strings.Replace(entry, " & ", "", -1)
|
|
entry = strings.Replace(entry, " ", "", -1)
|
|
|
|
name := fmt.Sprintf(conv, entry)
|
|
VPNNames[entry] = name
|
|
}(entry)
|
|
}
|
|
|
|
if len(VPNNames) == 0 {
|
|
return errors.New("Can't get a list of VPN endpoints"), nil
|
|
}
|
|
|
|
return nil, &VPNNames
|
|
}
|