| Crates.io | http-wasm-guest |
| lib.rs | http-wasm-guest |
| version | 0.7.0 |
| created_at | 2025-05-16 11:09:46.9406+00 |
| updated_at | 2025-08-04 13:36:57.725072+00 |
| description | a library providing a http-wasm guest handler |
| homepage | |
| repository | https://github.com/blndfsk/http-wasm-guest |
| max_upload_size | |
| id | 1676352 |
| size | 60,246 |
This library implements the Wasm Guest ABI, used to interface with http-wasm.
The main use is for writing traefik-plugins in rust.
Initial reference code from https://github.com/elisasre/http-wasm-rust/
API inspired by https://github.com/http-wasm/http-wasm-guest-tinygo
Implement the Guest-Trait and register the plugin.
use http_wasm_guest::{
Guest,
host::{Bytes, Request, Response},
register,
};
struct Plugin;
impl Guest for Plugin {
fn handle_request(&self, request: Request, _response: Response) -> (bool, i32) {
request.header().add(&Bytes::from("X-Foo"), &Bytes::from("Bar"));
(true, 0)
}
}
fn main() {
let plugin = Plugin;
register(plugin);
}
cargo build --target wasm32-wasip1 --examples