Skip to content

This is an example showing a WASM TARPC client using a websocket stream connecting to a server.

Notifications You must be signed in to change notification settings

john-hern/tarpc-wasm-client-tcp-server-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an example client server implementation using Yew, Tarpc, wsstreams (Server/Client wrappers for AsyncRead/Write byte streams) and Wasm-Timer shims.

Due to the way that Cargo builds in the root, we have to build everything explicitly. See Issue: rust-lang/cargo#7004

To build the server/rpc use:

cargo build -p rpc

cargo build -p server

To build the client use: wasm-pack build --target web --out-name wasm --out-dir ./static --debug

Start the client server using miniserve:

miniserve ./static --index index.html --interfaces 0.0.0.0 --port 8080

Start the Server.

Click Connect.

Send pings, echos.

Global Dependencies: Install the following global binaries via cargo install.

wasm-pack miniserve

About

This is an example showing a WASM TARPC client using a websocket stream connecting to a server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages