Wasmtime
Wasmtime is the reference implementation of the Component Model. It supports running components that implement the wasi:cli/command
world and serving components that implement the wasi:http/proxy
world.
Running command components with Wasmtime
To run a command component with Wasmtime, execute:
wasmtime run <path-to-wasm-file>
If you are using an older version of
wasmtime
, you may need to add the--wasm component-model
flag to specify that you are running a component rather than a core module.
By default, Wasmtime denies the component access to all system resources. For example, the component cannot access the file system or environment variables. See the Wasmtime guide for information on granting access, and for other Wasmtime features.
Running HTTP components with Wasmtime
You can now execute components that implement the HTTP proxy world with the wasmtime serve
subcommand. The Wasmtime CLI supports serving these components as of v14.0.3
.
To run a HTTP component with Wasmtime, execute:
wasmtime serve <path-to-wasm-file>
Try out building and running HTTP components with one of these tutorials
-
Hello WASI HTTP tutorial - build and serve a simple Rust-based HTTP component
-
HTTP Auth Middleware tutorial - compose a HTTP authentication middleware component with a business logic component