psanford / wormhole-william

End-to-end encrypted file transfer. A magic wormhole CLI and API in Go (golang).
MIT License
1.08k stars 55 forks source link

Replace websocket lib for WASM compatibility #46

Closed bryanchriswhite closed 3 years ago

bryanchriswhite commented 3 years ago

The websocket library being used currently does not support websockets in the browser, which means that when compiled, it would try to use the operating system's syscalls to make a tcp connection. Instead we want something, when compiled to wasm, would use browser's websocket/network stack.

The nhooyr.io/websocket library is wasm compatible and the changes needed to switch to it, is minimal.

psanford commented 3 years ago

Thanks for the pr. This seems to be the same as #44

bryanchriswhite commented 3 years ago

Oh, nice - I guess I was just a bit too slow to open it here :smile: