A WebSocket demo application using Rust WebAssembly (WASM) and Node.js.
- Rust and Cargo
- Node.js and npm
- wasm-pack
-
Install wasm-pack
cargo install wasm-pack
-
Install webpack
npm install webpack webpack-cli --save-dev
-
Node WebSocket Server
npm install ws
wasm-pack build --target web && npm run serve
# Terminal 1
wasm-pack build --target web
npm run serve
# Terminal 2
npm run start-server
Open the browser and navigate to http://localhost:4000