Simple demo on how to tackle blocking standard input/output when wrapping native command line programs in WebAssembly.
mkdir build
cd build
cmake ..
make
./stdio-demo
First set up Emscripten as instructed here.
mkdir build-wasm
cd build-wasm
emcmake cmake ..
make
../run_server.py
Now open https://localhost:8080/.