mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-25 13:14:18 +01:00
09e7fd8148a99c92ed40822f7c2d39f428a16056
* html: Upgrade xterm.js Upgrade xterm.js to the latest stable release. As part of this upgrade, the xterm packages have been scoped as the unscoped packages were not updated. The addons have also been upgraded to match the compatible versions. As part of this upgrade, a compatibility issue was identified with the Gulp task to inline source. By disabling compression, this allowed the task to complete successfully. The size of the source file `html.h` did not change significantly which indicates compression was not being applied previously. Signed-off-by: Michael Lorant <michael.lorant@nine.com.au> * html: rebuild header file --------- Signed-off-by: Michael Lorant <michael.lorant@nine.com.au> Co-authored-by: Shuanglei Tao <tsl0922@gmail.com>
ttyd - Share your terminal over the web
ttyd is a simple command-line tool for sharing terminal over the web.
Features
- Built on top of libuv and WebGL2 for speed
- Fully-featured terminal with CJK and IME support
- ZMODEM (lrzsz) / trzsz file transfer support
- Sixel image output support (img2sixel / lsix)
- SSL support based on OpenSSL / Mbed TLS
- Run any custom command with options
- Basic authentication support and many other custom options
- Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt, Windows
❤ Special thanks to JetBrains for sponsoring the opensource license to this project.
Installation
Install on macOS
Install on Linux
- Binary version (recommended): download from the releases page
- Install the snap:
sudo snap install ttyd --classic - Build from source (debian/ubuntu):
You may also need to compile/install libwebsockets from source if the
sudo apt-get update sudo apt-get install -y build-essential cmake git libjson-c-dev libwebsockets-dev git clone https://github.com/tsl0922/ttyd.git cd ttyd && mkdir build && cd build cmake .. make && sudo make installlibwebsockets-devpackage is outdated. - Install on OpenWrt:
opkg install ttyd - Install on Gentoo: clone the repo and follow the directions here.
Install on Windows
- Binary version (recommended): download from the releases page
- Install with Scoop:
scoop install ttyd - Compile on Windows
Usage
Command-line Options
USAGE:
ttyd [options] <command> [<arguments...>]
OPTIONS:
-p, --port Port to listen (default: 7681, use `0` for random port)
-i, --interface Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
-U, --socket-owner User owner of the UNIX domain socket file, when enabled (eg: user:group)
-c, --credential Credential for basic authentication (format: username:password)
-H, --auth-header HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
-u, --uid User id to run with
-g, --gid Group id to run with
-s, --signal Signal to send to the command when exit it (default: 1, SIGHUP)
-w, --cwd Working directory to be set for the child program
-a, --url-arg Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
-W, --writable Allow clients to write to the TTY (readonly by default)
-t, --client-option Send option to client (format: key=value), repeat to add more options
-T, --terminal-type Terminal type to report, default: xterm-256color
-O, --check-origin Do not allow websocket connection from different origin
-m, --max-clients Maximum clients to support (default: 0, no limit)
-o, --once Accept only one client and exit on disconnection
-B, --browser Open terminal with the default system browser
-I, --index Custom index.html path
-b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
-P, --ping-interval Websocket ping interval(sec) (default: 5)
-6, --ipv6 Enable IPv6 support
-S, --ssl Enable SSL
-C, --ssl-cert SSL certificate file path
-K, --ssl-key SSL key file path
-A, --ssl-ca SSL CA file path for client certificate verification
-d, --debug Set log level (default: 7)
-v, --version Print the version and exit
-h, --help Print this text and exit
Read the example usage on the wiki.
Browser Support
Modern browsers, See Browser Support.
Alternatives
Languages
C
56.2%
TypeScript
27%
Shell
6.5%
JavaScript
4%
CMake
4%
Other
2.3%
