Hm, might try hacking this into https://tsl0922.github.io/ttyd/
Let me know if you encounter any issues! I'm working on performance benchmarks now.