Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 1.35 KB

README.md

File metadata and controls

66 lines (42 loc) · 1.35 KB

Use Waki HTTP library to send HTTP(s) requests from inside WASM

Instructions for this devcontainer

This demo is partially based on instruction for official waki example.

Tested with Rust 1.83.0, waki examples v0.5.0, Wasmtime v27.0.0.

Preparation

  1. Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.

  2. Install WASI Preview 2 build target into Rust toolchain:

rustup target add wasm32-wasip2

Building

  1. cd into the folder of this example:
cd wasi-waki
  1. Clone the waki repo:
git clone --depth=1 https://github.com/wacker-dev/waki.git
  1. cd into the folder of HTTP client example:
cd waki/examples/client
  1. Compile the example:
cargo build --release

Test with Wasmtime

  1. Install Wasmtime:
curl https://wasmtime.dev/install.sh -sSf | bash
  1. Run Wasmtime with HTTP plugin enabled against just-compiled WASM file:
~/.wasmtime/bin/wasmtime -S http target/wasm32-wasip2/*/http-client.wasm
  1. See the results in terminal.

Finish

Perform your own experiments if desired.