feat: add horrible barely-working go ipn wasm code

This commit is contained in:
Aarnav Tale
2025-06-06 16:44:42 -04:00
parent f9751f5ab2
commit 7a6ad8d2d5
4 changed files with 799 additions and 127 deletions
+23
View File
@@ -0,0 +1,23 @@
//go:build js && wasm
package main
import (
"log"
"syscall/js"
"github.com/tale/headplane/internal/hp_ipn"
)
func main() {
js.Global().Set("newIPN", js.FuncOf(func(this js.Value, args []js.Value) any {
if len(args) != 1 {
log.Fatal("Usage: newIPN(config)")
return nil
}
return hp_ipn.NewIPN(args[0])
}))
<-make(chan bool)
}