Stream: git-wasmtime

Topic: wasmtime / issue #5071 Add WASI sockets support to the C API


view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 21:48):

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 the wasi_config_t struct to add a field for preopened sockets as well as a new wasi_config_preopen_socket API for populating this new wasi_config_t preopened sockets field.

Alternatives

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2022 at 15:48):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2022 at 18:07):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 10 2023 at 00:22):

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 the wasi_config_t struct to add a field for preopened sockets as well as a new wasi_config_preopen_socket API for populating this new wasi_config_t preopened sockets field.

Alternatives


Last updated: Nov 22 2024 at 16:03 UTC