summaryrefslogtreecommitdiff
path: root/pkg/backend/api.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-09-24 20:58:30 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-11-23 21:51:08 +0100
commit0efd19b935452a7b0b5561f9cba56b01ba7c627f (patch)
treef7ca08f78a76d64b0be83eef789ed6a935ca31d1 /pkg/backend/api.go
parentbe36ce80cac534afda4393fc6bd904d489b63361 (diff)
[feat] persist obfs4 & udp prefs
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r--pkg/backend/api.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index 96f3072..51fa377 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -80,7 +80,21 @@ func UseAutomaticGateway() {
}
func SetTransport(label string) {
- ctx.bm.SetTransport(label)
+ err := ctx.bm.SetTransport(label)
+ if err != nil {
+ log.Println(err)
+ }
+ if label == "obfs4" {
+ ctx.cfg.SetUseObfs4(true)
+ } else {
+ ctx.cfg.SetUseObfs4(false)
+ }
+ go trigger(OnStatusChanged)
+}
+
+func SetUDP(udp bool) {
+ log.Println("DEBUG setting UDP")
+ ctx.cfg.SetUseUDP(udp)
go trigger(OnStatusChanged)
}