diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-08-27 19:46:03 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-23 21:50:49 +0100 |
commit | 76585f828a36c08614df84f43d64e20fb0e7a425 (patch) | |
tree | 6edeb8fda8026da76bc51244fd0ed6de81174713 | |
parent | 0eb8afa826bddb165f5f2a5440c0ca147d351784 (diff) |
[feat] support udp via environment variable
interim commit
-rw-r--r-- | pkg/vpn/openvpn.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/vpn/openvpn.go b/pkg/vpn/openvpn.go index 3df5a23..b15530b 100644 --- a/pkg/vpn/openvpn.go +++ b/pkg/vpn/openvpn.go @@ -160,7 +160,12 @@ func (b *Bitmask) startOpenVPN() error { for _, gw := range gateways { for _, port := range gw.Ports { - arg = append(arg, "--remote", gw.IPAddress, port, "tcp4") + + if os.Getenv("UDP") == "1" && port != "53" { + arg = append(arg, "--remote", gw.IPAddress, port, "udp4") + } else { + arg = append(arg, "--remote", gw.IPAddress, port, "tcp4") + } } } } |