You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no C API equivalent of wasmtime_component_linker_add_wasip2 for wasi:http. Anyone using the C API or language bindings like wasmtime-py can't host components that make outbound HTTP calls through wasi:http/outgoing-handler.
The wasi-http feature implies wasi and is disabled by default since it brings in a lot of dependencies. Our team needs this for hosting components from Python. Is there any interest in this upstream?
One open question: since wasmtime-py ships a single prebuilt dylib, there's no way to optionally include wasi-http without distributing a separate artifact. Would it make sense to include it in the default release build, or would this need to be a separate distribution?
I don't think we ever reasoned through exactly why wasmtime-wasi-http was left out of the c-api aloud - I think its just an omission because nobody got to it. You're correct that it does bring in a lot of dependencies. However, it is also pretty important functionality, and generally speaking the wasmtime project wants to make your use case as easy as possible.
Maybe other maintainers can think of good reasons we shoudn't include wasmtime-wasi-http in the c-api. The c-api already depends on tokio (behind a default-enabled feature) as part of wasmtime-wasi, which is fairly heavyweight compared to the bygone pre-component non-async era, so I'm hopeful that adding hyper and the tls implementation is also acceptable.
If no objections exist, I think we should default to adding wasmtime-wasi-http to the c-api behind a feature, and enabling the feature by default. This should get it into wasmtime-py with the least amount of drama.
If for some reason we shouldnt take that path, right now the c-api doesn't appear to me to have the right sort of interfaces for applying wasmtime_wasi_http::add_only_http_to_linker_sync to a component::Linker without the c-api crate directly using the WasiHttpCtx struct and impling WasiHttpView in the manner your branch does. So, if we wanted to insist that wasmtime-wasi-http get packaged for the c-api as a separate static library, we would need to come up with interfaces in c-api that allow it.
I've completed a brief survey of the other maintainers and there are no objections at this time, so please send us a PR that adds wasmtime-wasi-http like in your branch, with feature on by default.
Activity
pchickey commentedon Apr 2, 2026
I don't think we ever reasoned through exactly why wasmtime-wasi-http was left out of the c-api aloud - I think its just an omission because nobody got to it. You're correct that it does bring in a lot of dependencies. However, it is also pretty important functionality, and generally speaking the wasmtime project wants to make your use case as easy as possible.
Maybe other maintainers can think of good reasons we shoudn't include wasmtime-wasi-http in the c-api. The c-api already depends on tokio (behind a default-enabled feature) as part of wasmtime-wasi, which is fairly heavyweight compared to the bygone pre-component non-async era, so I'm hopeful that adding hyper and the tls implementation is also acceptable.
If no objections exist, I think we should default to adding wasmtime-wasi-http to the c-api behind a feature, and enabling the feature by default. This should get it into wasmtime-py with the least amount of drama.
If for some reason we shouldnt take that path, right now the c-api doesn't appear to me to have the right sort of interfaces for applying
wasmtime_wasi_http::add_only_http_to_linker_syncto acomponent::Linkerwithout the c-api crate directly using theWasiHttpCtxstruct and implingWasiHttpViewin the manner your branch does. So, if we wanted to insist that wasmtime-wasi-http get packaged for the c-api as a separate static library, we would need to come up with interfaces in c-api that allow it.pchickey commentedon Apr 2, 2026
I've completed a brief survey of the other maintainers and there are no objections at this time, so please send us a PR that adds wasmtime-wasi-http like in your branch, with feature on by default.