Feature: 3 IP addresses per Windscribe server

This commit is contained in:
Quentin McGaw
2021-05-10 14:34:42 +00:00
parent 2d95edf8ab
commit 52ff03ae41
7 changed files with 349 additions and 329 deletions

View File

@@ -66,9 +66,16 @@ func (w *windscribe) GetOpenVPNConnection(selection configuration.ServerSelectio
return connection, fmt.Errorf("no server found for region %s", commaJoin(selection.Regions))
}
connections := make([]models.OpenVPNConnection, len(servers))
for i := range servers {
connections[i] = models.OpenVPNConnection{IP: servers[i].IP, Port: port, Protocol: selection.Protocol}
var connections []models.OpenVPNConnection
for _, server := range servers {
for _, ip := range server.IPs {
connection := models.OpenVPNConnection{
IP: ip,
Port: port,
Protocol: selection.Protocol,
}
connections = append(connections, connection)
}
}
return pickRandomConnection(connections, w.randSource), nil