diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-20 15:35:44 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-21 18:28:00 +0100 |
| commit | 6981666c6d8f639a1ff9c09a3bc08769e19928af (patch) | |
| tree | bdb94d76a7fb6a08ef200e9bbbbd5fff1d6b134c /internal/server/server.go | |
| parent | 697dfed1f9f5d2916889a81a7a64bd1158caf2d2 (diff) | |
Failover: Initial implementation
Diffstat (limited to 'internal/server/server.go')
| -rw-r--r-- | internal/server/server.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/server/server.go b/internal/server/server.go index 9354883..78f6472 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -1,6 +1,7 @@ package server import ( + "os" "time" "github.com/eduvpn/eduvpn-common/internal/oauth" @@ -219,7 +220,7 @@ func HasValidProfile(srv Server, wireguardSupport bool) (bool, error) { return false, err } // Profile does not support OpenVPN but the client also doesn't support WireGuard - if !p.supportsOpenVPN() && !wireguardSupport { + if !p.SupportsOpenVPN() && !wireguardSupport { return false, nil } return true, nil @@ -242,8 +243,9 @@ func Config(server Server, wireguardSupport bool, preferTCP bool) (string, strin return "", "", err } - ovpn := p.supportsOpenVPN() - wg := p.supportsWireguard() && wireguardSupport + ovpn := p.SupportsOpenVPN() + wg := p.SupportsWireguard() && wireguardSupport + // If we don't prefer TCP and this profile and client supports wireguard, // we disable openvpn if the EDUVPN_PREFER_WG environment variable is set // This is useful to force WireGuard if the profile supports both OpenVPN and WireGuard but the server still prefers OpenVPN |
