mirror of
https://github.com/tale/headplane.git
synced 2026-08-09 21:49:23 +00:00
feat: add horrible barely-working go ipn wasm code
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user