-
Notifications
You must be signed in to change notification settings - Fork 749
Support for wasm #661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Another important use case is to write a Envoy Proxy Filter https://istio.io/latest/docs/concepts/wasm/ |
any headway on this front? |
We have looked a bit at getting a port running under TinyGo. What specific use case are you looking for in the browser? I believe you can compile to wasm now and the Go client has websocket support, so wanted to make sure I understood the ask. |
@derekcollison I'm simply trying to figure out if it's possible to run golang/webassembly in the web browser, while using the go websocket client. |
Not sure if that would be a good experience over the TS/JS client or not. I think you would need to bridge to JS for access to the websocket IIRC. |
All we need is a generic interface for sending/recv'ing websocket frames which works both natively and in the browser, right? |
there are a slew of other languages which compile to wasm in the browser (ie c#, rust, assemblyscript, c++, etc.), using golang would be my preferred way of bridging over to them via a homegrown local event bus which runs in the browser. |
@gedw99 the TS/JS clients can do the same. I believe you would need to jump through to JS to access the websocket from the TS/JS client regardless. But I could be wrong. |
@derekcollison that is correct, but that's a pretty simple interop between golang/js, right? per the framing i mentioned earlier? |
see the webassembly example in pion as a reference |
Will take a look, thanks. |
I am supportive of getting the client to compile under TinyGO, or have another client targeting it. I believe the only thing is the encoded connections and GOB IIRC. |
Unfortunately this might not be feasible at this time due to upstream blockers. It seems that TinyGo doesn't support some of the prerequisite runtime functionality needed, such as timers (tinygo-org/tinygo#1037) so ultimately I don't think it's feasible to implement this without having a specialized implementation that avoids the use of those runtime calls completely. |
There will be a TinyGo client in the future. |
Is there any plan to support wasm with websocket? |
Feature Request
Support for WebAssembly
Use Case:
Use NATS from browser without using JS binding.
Proposed Change:
Add support for wasm.
Who Benefits From The Change(s)?
People who want to use NATS in WebAssembly.
Alternative Approaches
Use JS binding.
The text was updated successfully, but these errors were encountered: