3

Example Usage · tsl0922/ttyd Wiki · GitHub

 2 years ago
source link: https://github.com/tsl0922/ttyd/wiki/Example-Usage
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Table of Contents

Basic Usage

ttyd starts web server at port 7681 by default, you can use the -p option to change it, the command will be started with arguments as options. For example, run:

ttyd -p 8080 bash

Then open http://localhost:8080 with a browser, you will get a bash shell with debug mode enabled.

More Examples:

  • If you want to login with your system accounts on the web browser, run ttyd login.
  • You can even run a none shell command like vim, try: ttyd vim, the web browser will show you a vim editor.
  • Sharing single process with multiple clients: ttyd tmux new -A -s ttyd vim, run tmux new -A -s ttyd to connect to the tmux session from terminal.
  • Using client options.

Docker image

  • Sharing single docker container with multiple clients: docker run -it --rm -p 7681:7681 tsl0922/ttyd.
  • Creating new docker container for each client: ttyd docker run -it --rm ubuntu.

Browser specifics

Chrome users might be interested in launching chrome as chrome --app=https://www.example.com/ttyd, as this allows Ctrl+n, Ctrl+w etc. to be passed to the terminal.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK