Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.22 KB

File metadata and controls

41 lines (30 loc) · 1.22 KB

Wasm UDP Echo Example

Prerequisites

  1. Rust
  2. cargo-component
  3. wit-bindgen-cli
  4. wasm-tools
  5. wac

The component tooling dependencies can be installed via cargo from a working Rust installation:

cargo install cargo-component  # to build the project
cargo install wit-bindgen-cli  # to generate the guest bindings
cargo install wasm-tools       # to get data from the wasm artifacts
cargo install wac              # to link and create the stubs

Building

cargo component build

Running

To run with Hyperlight-Wasm, see the example host repository.

To run with wasmtime directly for development and testing:

wasmtime run -Sinherit-network target/wasm32-wasip1/debug/udp_echo_server.wasm

In either case, the wasm component should produce no standard output and wait forever to receive datagrams via UDP on 127.0.0.1 port 8080.