This devcontainer is configured to provide you a wasi-sdk 20.0.
-
Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
-
Download the
extism-pdk.h
header file, the only required part of Extism C PDK:
wget https://raw.githubusercontent.com/extism/c-pdk/main/extism-pdk.h
- Compile the example:
clang -o HTTPRequestingPlugin.wasm -mexec-model=reactor httpget.c
For testing purposes, you can invoke functions from Extism plugins with Extism CLI.
- Install
Extism CLI
from Github releases:
wget https://github.com/extism/cli/releases/download/v0.3.4/extism-v0.3.4-linux-amd64.tar.gz
tar -xzf extism-v0.3.4-linux-amd64.tar.gz
And now you have extism
binary in current folder.
- Run
httpget
function from extism plugin with CLI, allowing outbound connections to all hosts:
./extism call HTTPRequestingPlugin.wasm httpget --allow-host '*' --wasi
Perform your own experiments if desired.
This devcontainer is based on ideas from dev-wasm/dev-wasm-c.
Created for (wannabe-awesome) list