summaryrefslogtreecommitdiff
path: root/gui/backend.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-09-08 02:23:18 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-09-08 19:58:25 +0200
commite591c3147e3c504611ff612e8918018125ffa2eb (patch)
treed4004f33ddc2c7f9f70d95d0244b93ac27b9eb76 /gui/backend.go
parentc2871f4aece61b939e0e6c8d7a94677fb055620a (diff)
[bug] pass json as bytes to go side
Diffstat (limited to 'gui/backend.go')
-rw-r--r--gui/backend.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/backend.go b/gui/backend.go
index 5fa6134..a1dafe8 100644
--- a/gui/backend.go
+++ b/gui/backend.go
@@ -7,6 +7,7 @@ package main
import (
"C"
+ "log"
"unsafe"
"0xacab.org/leap/bitmask-vpn/pkg/backend"
@@ -53,8 +54,11 @@ func SubscribeToEvent(event string, f unsafe.Pointer) {
}
//export InitializeBitmaskContext
-func InitializeBitmaskContext() {
- opts := &backend.InitOpts{}
+func InitializeBitmaskContext(provider string, jsonPtr unsafe.Pointer, jsonLen C.int) {
+ log.Println("DEBUG: provider=", provider)
+ json := C.GoBytes(jsonPtr, jsonLen)
+ log.Println("DEBUG: json=", string(json))
+ opts := backend.InitOptsFromJSON(provider, string(json))
backend.InitializeBitmaskContext(opts)
}