A telnet chat server written in Rust, running on Lunatic.
I wrote a blog post about the implementation, you can read it here.
If you just would like to try it out, join the hosted version with:
# US server
telnet lunatic.chat
# EU server
telnet eu.lunatic.chat
You should pick the one closer to you as all the rendering is done on the backend and lower latency will mean better UX.
The server is written in Rust. The Rust code is then compiled to WebAssembly and runs on top of Lunatic. Each connection runs in a separate (lightweight) process, has it's own state and sends just a diff of esc-sequences back to the terminal to bring it up to date with the current render buffer.
If you have rustup installed:
# Add Rust nightly:
> rustup toolchain add nightly
# Add the wasm32-wasi target
> rustup target add wasm32-wasi
# Build the project
> cargo +nightly build
To run it, you will need to have lunatic on your PATH.
If this is the case you can just run cargo +nightly run
or find the generated telnet-chat.wasm
file
in the target folder and run it with lunatic path/to/telnet-chat.wasm
.
MIT