Mullvad servers do not have a default port

- Refers to #218
- Checks for custom port value depending on protocol
- Remove default port from server constants
- Use 443 and 1194 ports respectively for tcp and udp
This commit is contained in:
Quentin McGaw
2020-08-24 01:53:24 +00:00
parent 7e3e6f166a
commit 6fc2b3dd21
5 changed files with 375 additions and 440 deletions

View File

@@ -42,8 +42,13 @@ func (m *mullvad) GetOpenVPNConnections(selection models.ServerSelection) (conne
return nil, fmt.Errorf("no server found for country %q, city %q and ISP %q", selection.Country, selection.City, selection.ISP)
}
var defaultPort uint16 = 1194
if selection.Protocol == constants.TCP {
defaultPort = 443
}
for _, server := range servers {
port := server.DefaultPort
port := defaultPort
if selection.CustomPort > 0 {
port = selection.CustomPort
}