WebAssembly / WASI

WebAssembly System Interface
Other
4.71k stars 240 forks source link

How to use sock in WASI? #600

Closed bnmcxlzd closed 1 month ago

bnmcxlzd commented 2 months ago

How can I write a C program that uses a sock and compile it into Wasm binaries? Are there any examples?

ricochet commented 1 month ago

Checkout the sockets test in wasmtime for a rust version of this: crates/test-programs/src/sockets.rs.

For C, you would use the wasi-sdk.