http-wasm-guest

Crates.iohttp-wasm-guest
lib.rshttp-wasm-guest
version0.7.0
created_at2025-05-16 11:09:46.9406+00
updated_at2025-08-04 13:36:57.725072+00
descriptiona library providing a http-wasm guest handler
homepage
repositoryhttps://github.com/blndfsk/http-wasm-guest
max_upload_size
id1676352
size60,246
(blndfsk)

documentation

README

http-wasm Guest Library

Build

This library implements the Wasm Guest ABI, used to interface with http-wasm.

The main use is for writing traefik-plugins in rust.

Usage

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);
}

Example

cargo build --target wasm32-wasip1 --examples

Commit count: 20

cargo fmt