Open Mikerah opened 4 years ago
Turns out 2) doesn't work as intended since Go only returns a shared library file. It opens up the ability to use node-ffi but there's better options than that.
The solution that I employed is to compile katzenpost/client to wasm and then use wasm support in js to get bindings. It works well so far at the expense of a relatively large .wasm file. I expect improvements in the short to mid term.
Reopening issue because the initial method failed. It turns out to compile to wasm using the provide Go tools, one needs to use a main package. As such, there is a potential bug in the Go provided wasm_exec.js
file used to interact with the Go generated wasm file from nodejs.
Looking into other methods to see how to get around this while I wait for an answer.
There are a few ways to get js bindings for Go code. There are the following:
I'm leaning towards option 2 as katzenpost already has c bindings.