Skip to content
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

Dmsg for WASM / browser runtime #295

Open
0pcom opened this issue Jan 11, 2025 · 1 comment
Open

Dmsg for WASM / browser runtime #295

0pcom opened this issue Jan 11, 2025 · 1 comment
Labels
enhancement New feature or request investigate examine for potential improvements

Comments

@0pcom
Copy link
Collaborator

0pcom commented Jan 11, 2025

Golang’s net package (used by dmsg) does not directly support WebAssembly (Wasm) due to the limitations of the WASI (WebAssembly System Interface) API. Specifically, WASI API does not fully implement network sockets.

However, third-party libraries can provide the necessary functionality. One such library is dispatchrun/net (formerly stealthrocket/net), which uses the go:wasmimport compiler directive to allow the use of net.Dial and net.Listen on supported Wasm hosts.

This (potentially) enables the use of net.Dial, the creation of net/http servers, and other network-related functionality.

https://github.com/dispatchrun/net

We should further investigate this for browser-based dmsg applications

@0pcom
Copy link
Collaborator Author

0pcom commented Jan 13, 2025

To clarify @mrpalide we should just investigate potential use.

Not to totally replace the net standard library import for dmsg with this one.

I doubt this other library will replace "net" in non-wasm context

@0pcom 0pcom added enhancement New feature or request investigate examine for potential improvements labels Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigate examine for potential improvements
Projects
None yet
Development

No branches or pull requests

1 participant