1 unstable release

0.1.0 Jun 3, 2023

#306 in WebSocket

Custom license

1.5MB
503 lines

RuTTY - Rust TTY Server

Crates.io Build

RuTTY (aka Ruthie) is a CLI-powered websocket server written in Rust that allows you to expose your commands via browser. RuTTY was written with the sole-purpose of me wanting to expermient with Rust.

How it works?

RuTTY was heavily inspired by a very similar tool written in Go, called GoTTY.

RuTTY run a command for each client connection, forwards the TTY stdout to the client, and forwards the client input to the TTY stdin. RuTTY uses xterm.js to show a TTY display on the webpage.

Usage

To run rutty simply run rutty and add your command and any optional arguments to that command, e.g. rutty vi test.txt.

Options

Option Description Default
-address (-a) Server listening IP address 0.0.0.0 (All interfaces)
-port (-p) Server listening port 3000
-allow-write (-w) Wether clients are allowed to pass input false
--title (-t) HTML page title RuTTY Server
--reconnect (-r) Automatic reconnection delay None (no automatic reconnection)

Development

Clone the repository, install rust, node& yarn.

Build

Debug build: make build.
Release build: make build release=1

Run

cargo run -- <COMMAND> <ARGS>

Web development

An automatic hot-reload of the static files can be done by running yarn start inside the web directory, which will use parcel to start a development server on http://localhost:1234 that is proxied to your RuTTY server running on port 3000.

License

MIT

Dependencies

~17–28MB
~398K SLoC