diff options
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r-- | pkg/backend/api.go | 16 |
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) } |