font opened issue #5071:
Feature
The
wasmtime
CLI supports the--tcplisten
and--listenfd
options for WASI sockets support, but the C API is missing support for these same WASI socket features. This issue is to track adding support for WASI networking in the C API.Benefit
This aids the ability for C applications that leverage the wasmtime C shared library API for executing WASM modules to support networking features for those modules.
Implementation
The existing WASI networking features that are supported in the
wasmtime
CLI code path need to be plumbed through to the C API. For example, this will involve expanding thewasi_config_t
struct to add a field for preopened sockets as well as a newwasi_config_preopen_socket
API for populating this newwasi_config_t
preopened sockets field.Alternatives
stassss2011 commented on issue #5071:
I am also interested in this feature. With the implementation of sockets in C API, we will be able to add networking support to the wasmtime handler of containers/crun project. And further, we would be able to run wasm networking containers with usual
podman run -p port:port
command. In fact, I am stuck on this issue right now in my attempt to run ASP.NET in k8s via wasm runtime.
font commented on issue #5071:
I've been working on this and have it mostly working already. I hope to be able to create a PR soon.
peterhuene closed issue #5071:
Feature
The
wasmtime
CLI supports the--tcplisten
and--listenfd
options for WASI sockets support, but the C API is missing support for these same WASI socket features. This issue is to track adding support for WASI networking in the C API.Benefit
This aids the ability for C applications that leverage the wasmtime C shared library API for executing WASM modules to support networking features for those modules.
Implementation
The existing WASI networking features that are supported in the
wasmtime
CLI code path need to be plumbed through to the C API. For example, this will involve expanding thewasi_config_t
struct to add a field for preopened sockets as well as a newwasi_config_preopen_socket
API for populating this newwasi_config_t
preopened sockets field.Alternatives
Last updated: Dec 23 2024 at 12:05 UTC