chore(models): streamline all server models IPs (#942)
- Use `IPs []net.IP` for all server models - Use `ips` JSON field for all server models - Merge IPv4 and IPv6 addresses together for Mullvad
This commit is contained in:
@@ -21,15 +21,17 @@ func (n *Nordvpn) GetConnection(selection settings.ServerSelection) (
|
||||
return connection, err
|
||||
}
|
||||
|
||||
connections := make([]models.Connection, len(servers))
|
||||
for i := range servers {
|
||||
connection := models.Connection{
|
||||
Type: selection.VPN,
|
||||
IP: servers[i].IP,
|
||||
Port: port,
|
||||
Protocol: protocol,
|
||||
connections := make([]models.Connection, 0, len(servers))
|
||||
for _, server := range servers {
|
||||
for _, ip := range server.IPs {
|
||||
connection := models.Connection{
|
||||
Type: selection.VPN,
|
||||
IP: ip,
|
||||
Port: port,
|
||||
Protocol: protocol,
|
||||
}
|
||||
connections = append(connections, connection)
|
||||
}
|
||||
connections[i] = connection
|
||||
}
|
||||
|
||||
return utils.PickConnection(connections, selection, n.randSource)
|
||||
|
||||
Reference in New Issue
Block a user