diff options
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())) |