Maint: common GetProtocol for OpenVPN+Wireguard providers
This commit is contained in:
13
internal/provider/utils/protocol.go
Normal file
13
internal/provider/utils/protocol.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/configuration"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
func GetProtocol(selection configuration.ServerSelection) (protocol string) {
|
||||
if selection.VPN == constants.OpenVPN && selection.OpenVPN.TCP {
|
||||
return constants.TCP
|
||||
}
|
||||
return constants.UDP
|
||||
}
|
||||
Reference in New Issue
Block a user