Feat: OPENVPN_TARGET_IP overrides IP

- Check target IP matches a server for Wireguard since we need the public key
- Streamline connection picking for all providers
This commit is contained in:
Quentin McGaw (desktop)
2021-08-28 19:07:44 +00:00
parent c6fedd9214
commit 119cac5a67
20 changed files with 61 additions and 118 deletions

View File

@@ -38,15 +38,5 @@ func (p *PIA) GetConnection(selection configuration.ServerSelection) (
}
}
if selection.TargetIP != nil {
connection, err = utils.GetTargetIPConnection(connections, selection.TargetIP)
} else {
connection, err = utils.PickRandomConnection(connections, p.randSource), nil
}
if err != nil {
return connection, err
}
return connection, nil
return utils.PickConnection(connections, selection, p.randSource)
}