diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-11-30 18:49:00 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-30 21:22:45 +0100 |
commit | 52206cc7dda3d12d92dad3181e27b680c70e69e3 (patch) | |
tree | a28f33a102f2d703a622b9f332e98c913e3d3095 /pkg/helper/helper.go | |
parent | 0419a17814fba437e111d0335fb05a9806f9589f (diff) |
[feat] udp nameservers
Diffstat (limited to 'pkg/helper/helper.go')
-rw-r--r-- | pkg/helper/helper.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/helper/helper.go b/pkg/helper/helper.go index d23cefd..7b6643b 100644 --- a/pkg/helper/helper.go +++ b/pkg/helper/helper.go @@ -122,6 +122,12 @@ func (openvpn *openvpnT) kill() error { } func firewallStartHandler(w http.ResponseWriter, r *http.Request) { + mode := "tcp" + query := r.URL.Query() + udp, udpParam := query["udp"] + if udpParam && len(udp) == 1 && udp[0] == "1" { + mode = "udp" + } gateways, err := getArgs(r) if err != nil { log.Printf("An error has occurred processing gateways: %v", err) @@ -135,7 +141,7 @@ func firewallStartHandler(w http.ResponseWriter, r *http.Request) { } } - err = firewallStart(gateways) + err = firewallStart(gateways, mode) if err != nil { log.Printf("Error starting firewall: %v", err) w.Write([]byte(err.Error())) |