@@ -6,8 +6,10 @@ type OpenVPNConnection struct {
|
||||
IP net.IP
|
||||
Port uint16
|
||||
Protocol NetworkProtocol
|
||||
Hostname string // Privado for tls verification
|
||||
}
|
||||
|
||||
func (o *OpenVPNConnection) Equal(other OpenVPNConnection) bool {
|
||||
return o.IP.Equal(other.IP) && o.Port == other.Port && o.Protocol == other.Protocol
|
||||
return o.IP.Equal(other.IP) && o.Port == other.Port && o.Protocol == other.Protocol &&
|
||||
o.Hostname == other.Hostname
|
||||
}
|
||||
|
||||
@@ -130,6 +130,11 @@ func (p *ProviderSettings) String() string {
|
||||
"Countries: "+commaJoin(p.ServerSelection.Countries),
|
||||
"Cities: "+commaJoin(p.ServerSelection.Cities),
|
||||
)
|
||||
case "privado":
|
||||
settingsList = append(settingsList,
|
||||
"Cities: "+commaJoin(p.ServerSelection.Cities),
|
||||
"Server numbers: "+commaJoin(numbers),
|
||||
)
|
||||
default:
|
||||
settingsList = append(settingsList,
|
||||
"<Missing String method, please implement me!>",
|
||||
|
||||
@@ -107,6 +107,17 @@ func (s *PurevpnServer) String() string {
|
||||
s.Region, s.Country, s.City, goStringifyIPs(s.IPs))
|
||||
}
|
||||
|
||||
type PrivadoServer struct {
|
||||
IP net.IP `json:"ip"`
|
||||
City string `json:"city"`
|
||||
Number uint16 `json:"number"`
|
||||
}
|
||||
|
||||
func (s *PrivadoServer) String() string {
|
||||
return fmt.Sprintf("{City: %q, Number: %d, IP: %s}",
|
||||
s.City, s.Number, goStringifyIP(s.IP))
|
||||
}
|
||||
|
||||
func goStringifyIP(ip net.IP) string {
|
||||
s := fmt.Sprintf("%#v", ip)
|
||||
s = strings.TrimSuffix(strings.TrimPrefix(s, "net.IP{"), "}")
|
||||
|
||||
@@ -6,6 +6,7 @@ type AllServers struct {
|
||||
Mullvad MullvadServers `json:"mullvad"`
|
||||
Nordvpn NordvpnServers `json:"nordvpn"`
|
||||
Pia PiaServers `json:"pia"`
|
||||
Privado PrivadoServers `json:"privado"`
|
||||
Purevpn PurevpnServers `json:"purevpn"`
|
||||
Surfshark SurfsharkServers `json:"surfshark"`
|
||||
Vyprvpn VyprvpnServers `json:"vyprvpn"`
|
||||
@@ -32,6 +33,11 @@ type PiaServers struct {
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []PIAServer `json:"servers"`
|
||||
}
|
||||
type PrivadoServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Servers []PrivadoServer `json:"servers"`
|
||||
}
|
||||
type PurevpnServers struct {
|
||||
Version uint16 `json:"version"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
|
||||
Reference in New Issue
Block a user