summaryrefslogtreecommitdiff
path: root/pkg/backend/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r--pkg/backend/api.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index 8d6d049..761c03d 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -7,6 +7,7 @@ import (
"encoding/json"
"log"
"strconv"
+ "time"
"unsafe"
"0xacab.org/leap/bitmask-vpn/pkg/bitmask"
@@ -54,10 +55,14 @@ func SwitchOff() {
go stopVPN()
}
-// TODO implement Reconnect?
+// TODO implement Reconnect - do not tear whole fw down in between
func UseGateway(label string) {
- ctx.bm.UseGateway(label)
+ ctx.bm.UseGateway(string(label))
+ time.Sleep(200 * time.Millisecond)
+ SwitchOff()
+ time.Sleep(500 * time.Millisecond)
+ SwitchOn()
}
func UseTransport(label string) {