diff options
-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") + } } } } |