Feature: Hide My Ass VPN provider support (#401)

This commit is contained in:
Quentin McGaw
2021-03-05 22:45:54 -05:00
committed by GitHub
parent 8b36ce198f
commit be72f4a046
23 changed files with 924 additions and 8 deletions

View File

@@ -17,6 +17,21 @@ func (s *CyberghostServer) String() string {
return fmt.Sprintf("{Region: %q, Group: %q, IPs: %s}", s.Region, s.Group, goStringifyIPs(s.IPs))
}
type HideMyAssServer struct {
Country string `json:"country"`
Region string `json:"region"`
City string `json:"city"`
Hostname string `json:"hostname"`
TCP bool `json:"tcp"`
UDP bool `json:"udp"`
IPs []net.IP `json:"ips"`
}
func (s *HideMyAssServer) String() string {
return fmt.Sprintf("{Country: %q, Region: %q, City: %q, Hostname: %q, TCP: %t, UDP: %t, IPs: %s}",
s.Country, s.Region, s.City, s.Hostname, s.TCP, s.UDP, goStringifyIPs(s.IPs))
}
type MullvadServer struct {
IPs []net.IP `json:"ips"`
IPsV6 []net.IP `json:"ipsv6"`

View File

@@ -3,6 +3,7 @@ package models
type AllServers struct {
Version uint16 `json:"version"`
Cyberghost CyberghostServers `json:"cyberghost"`
HideMyAss HideMyAssServers `json:"hidemyass"`
Mullvad MullvadServers `json:"mullvad"`
Nordvpn NordvpnServers `json:"nordvpn"`
Privado PrivadoServers `json:"privado"`
@@ -16,6 +17,7 @@ type AllServers struct {
func (a *AllServers) Count() int {
return len(a.Cyberghost.Servers) +
len(a.HideMyAss.Servers) +
len(a.Mullvad.Servers) +
len(a.Nordvpn.Servers) +
len(a.Privado.Servers) +
@@ -32,6 +34,11 @@ type CyberghostServers struct {
Timestamp int64 `json:"timestamp"`
Servers []CyberghostServer `json:"servers"`
}
type HideMyAssServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`
Servers []HideMyAssServer `json:"servers"`
}
type MullvadServers struct {
Version uint16 `json:"version"`
Timestamp int64 `json:"timestamp"`