noVNC/core/wasm
Joel Martin 9efc362c82 wasm: draw/fill a canvas with solid color. 2018-07-25 16:48:48 +09:00
..
src wasm: draw/fill a canvas with solid color. 2018-07-25 16:48:48 +09:00
Cargo.toml wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00
Dockerfile wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00
README.md wasm: draw/fill a canvas with solid color. 2018-07-25 16:48:48 +09:00
index.html wasm: draw/fill a canvas with solid color. 2018-07-25 16:48:48 +09:00
index.js wasm: draw/fill a canvas with solid color. 2018-07-25 16:48:48 +09:00
package.json wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00
webpack.config.js wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00

README.md

noVNC + wasm

The following example is based on this tutorial:

https://hacks.mozilla.org/2018/04/javascript-to-rust-and-back-again-a-wasm-bindgen-tale/

and this example:

https://github.com/rustwasm/wasm-bindgen/blob/master/examples/julia_set/

Prep:

docker build -t rust-wasm ./core/wasm

docker run -it -v `pwd`:/novnc -w /novnc/core/wasm -p 8080:8080 rust-wasm bash

npm install

Build:

cargo +nightly build --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/debug/novnc.wasm --out-dir .
npm run serve   # then visit localhost:8080 outside the container