Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

wrpc

> 编程语言
Open source

Wasm component-native RPC framework

333 stars0 likes1 views
WebsiteGitHub

About

Wasm component-native RPC framework

About

wRPC facilitates execution of arbitrary functionality defined in WIT over network or other means of communication.

Main use cases for wRPC are:

  • out-of-tree WebAssembly runtime plugins
  • distributed WebAssembly component communication

Even though wRPC is designed for Wasm components first and foremost, it is fully usable outside of WebAssembly context and can serve as a general-purpose RPC framework.

wRPC uses component model value definiton encoding on the wire.

wRPC supports both dynamic (based on e.g. runtime WebAssembly component type introspection) and static use cases.

For static use cases, wRPC provides WIT binding generators for:

  • Rust
  • Go

wRPC fully supports the unreleased native WIT stream and future data types along with all currently released WIT functionality.

See specification for more info.

Installation

  • Using cargo:

    bash
    cargo install wrpc
  • Using nix:

    bash
    nix profile install github:bytecodealliance/wrpc

    or, without installing:

    nix shell github:bytecodealliance/wrpc
  • You can also download individual binaries from the release page

Quickstart

wRPC usage examples for different programming languages can be found at examples.

There are 2 different kinds of examples:

  • Native wRPC applications, tied to a particular wRPC transport (like Unix Domain Sockets, TCP, QUIC, WebTransport or WebSockets)
  • Generic Wasm components, that need to run in a Wasm runtime. Those can be executed, for example, using wrpc-wasmtime, to polyfill imports at runtime and serve exports using wRPC.

Requirements

  • For Rust components and wRPC applications: rust >= 1.93

Nix users can run nix develop anywhere in the repository to get all dependencies correctly set up

hello example

In this example we will serve and invoke a simple hello application.

Rust components

We will use the following two Rust components:

  • examples/rust/hello-component-client
  • examples/rust/hello-component-server

We will have to build these components first:

  • Build Wasm hello client:

    bash
    cargo build --release -p hello-component-client --target wasm32-wasip2

    Output is in target/wasm32-wasip2/release/hello-component-client.wasm

  • Build Wasm hello server:

    bash
    cargo build --release -p hello-component-server --target wasm32-wasip2

    Output is in target/wasm32-wasip2/release/hello_component_server.wasm

    NB: Rust uses _ separators in the filename, because a component is built as a reactor-style library

Using TCP transport

We will use the following two Rust wRPC applications using TCP transport:

  • examples/rust/hello-tcp-client
  • examples/rust/hello-tcp-server

[::1]:7761 is used as the default address

  1. Serve Wasm hello server via TCP

    bash
    wrpc-wasmtime tcp serve ./target/wasm32-wasip2/release/hello_component_server.wasm
    • Sample output:

    INFO wrpc_wasmtime_cli: serving instance function name="hello"

  2. Call Wasm hello server using a Wasm hello client via TCP:

    bash
    wrpc-wasmtime tcp run ./target/wasm32-wasip2/release/hello-component-client.wasm
    • Sample output in the client:

    hello from Rust

    • Sample output in the server:

    INFO wrpc_wasmtime_cli: serving instance function invocation

    INFO wrpc_wasmtime_cli: successfully served instance function invocation

  3. Call the Wasm hello server using a native wRPC hello client via TCP:

    bash
    cargo run -p hello-tcp-client
  4. Serve native wRPC hello server via TCP:

    bash
    cargo run -p hello-tcp-server [::1]:7762
  5. Call native wRPC hello server using native wRPC hello client via TCP:

    bash
    cargo run -p hello-tcp-client [::1]:7762
  6. Call native wRPC hello server using Wasm hello client via TCP:

    bash
    wrpc-wasmtime tcp run --import [::1]:7762 ./target/wasm32-wasip2/release/hello-component-client.wasm

Repository structure

This repository contains (for all supported languages):

  • core libraries and abstractions
  • binding generators
  • WebAssembly runtime integrations
  • wRPC transport implementations

wit-bindgen-wrpc aims to closely match UX of wit-bindgen and therefore includes a subtree merge of the project, which is occasionally merged into this tree.

  • wRPC binding generators among other tests, are tested using the wit-bindgen test suite
  • wit-bindgen documentation is reused where applicable

Contributing

Welcome, new contributors!

Whether you're a seasoned developer or just getting started, your contributions are valuable to us. Don't hesitate to jump in, explore the project, and make an impact. To start contributing, please check out our Contribution Guidelines.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustasynccomponent-modelwasmwit

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言