2015-08-25 00:37:56 +08:00
|
|
|
# gotty-client
|
2015-11-02 02:33:28 +08:00
|
|
|
:wrench: Terminal client for [GoTTY](https://github.com/yudai/gotty).
|
2015-08-25 00:51:46 +08:00
|
|
|
|
2015-09-29 04:12:02 +08:00
|
|
|
![](https://raw.githubusercontent.com/moul/gotty-client/master/resources/gotty-client.png)
|
|
|
|
|
2015-08-25 19:33:56 +08:00
|
|
|
[![Build Status](https://travis-ci.org/moul/gotty-client.svg?branch=master)](https://travis-ci.org/moul/gotty-client)
|
2015-08-25 00:51:46 +08:00
|
|
|
[![GoDoc](https://godoc.org/github.com/moul/gotty-client?status.svg)](https://godoc.org/github.com/moul/gotty-client)
|
2017-07-20 16:20:27 +08:00
|
|
|
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client?ref=badge_shield)
|
2018-12-27 23:32:12 +08:00
|
|
|
[![Sourcegraph](https://sourcegraph.com/github.com/moul/gotty-client/-/badge.svg)](https://sourcegraph.com/github.com/moul/gotty-client?badge)
|
2015-08-25 00:51:46 +08:00
|
|
|
|
2015-08-28 21:47:26 +08:00
|
|
|
```ruby
|
2020-03-13 23:56:05 +08:00
|
|
|
+----------------+
|
|
|
|
+--------------+ +---------+--->| /bin/bash |
|
|
|
|
| | | | +----------------+
|
|
|
|
+-->| Browser |--+ | |
|
|
|
|
+-------+ | | | | | |
|
|
|
|
| | | +--------------+ | | | +----------------+
|
|
|
|
| Bob |--+ +-websocket-->| Gotty |--->| emacs /var/www |
|
|
|
|
| | | XXXXXXXXXXXXXX | | | +----------------+
|
|
|
|
+-------+ | X X | | |
|
|
|
|
+-->X gotty-client X--+ | |
|
|
|
|
X X | | +----------------+
|
|
|
|
XXXXXXXXXXXXXX +---------+--->| tmux attach |
|
|
|
|
+----------------+
|
2015-08-28 21:46:00 +08:00
|
|
|
```
|
|
|
|
|
2015-10-11 05:49:22 +08:00
|
|
|
## Example
|
2015-08-25 00:55:24 +08:00
|
|
|
|
2015-10-11 05:42:05 +08:00
|
|
|
Server side ([GoTTY](https://github.com/yudai/gotty))
|
2015-08-25 00:55:24 +08:00
|
|
|
|
|
|
|
```console
|
|
|
|
$ gotty -p 9191 sh -c 'while true; do date; sleep 1; done'
|
|
|
|
2015/08/24 18:54:31 Server is starting with command: sh -c while true; do date; sleep 1; done
|
|
|
|
2015/08/24 18:54:31 URL: http://[::1]:9191/
|
|
|
|
2015/08/24 18:54:34 GET /ws
|
|
|
|
2015/08/24 18:54:34 New client connected: 127.0.0.1:61811
|
|
|
|
2015/08/24 18:54:34 Command is running for client 127.0.0.1:61811 with PID 64834
|
|
|
|
2015/08/24 18:54:39 Command exited for: 127.0.0.1:61811
|
|
|
|
2015/08/24 18:54:39 Connection closed: 127.0.0.1:61811
|
2015-10-11 05:42:05 +08:00
|
|
|
...
|
2015-08-25 00:55:24 +08:00
|
|
|
```
|
|
|
|
|
2015-10-11 05:42:05 +08:00
|
|
|
**Client side**
|
|
|
|
|
2015-08-25 00:55:24 +08:00
|
|
|
```console
|
|
|
|
$ gotty-client http://localhost:9191/
|
|
|
|
INFO[0000] New title: GoTTY - sh -c while true; do date; sleep 1; done (jean-michel-van-damme.local)
|
|
|
|
WARN[0000] Unhandled protocol message: json pref: 2{}
|
|
|
|
Mon Aug 24 18:54:34 CEST 2015
|
|
|
|
Mon Aug 24 18:54:35 CEST 2015
|
|
|
|
Mon Aug 24 18:54:36 CEST 2015
|
|
|
|
Mon Aug 24 18:54:37 CEST 2015
|
|
|
|
Mon Aug 24 18:54:38 CEST 2015
|
|
|
|
^C
|
|
|
|
```
|
|
|
|
|
2015-10-11 05:49:22 +08:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ gotty-client -h
|
|
|
|
NAME:
|
|
|
|
gotty-client - GoTTY client for your terminal
|
|
|
|
|
|
|
|
USAGE:
|
|
|
|
gotty-client [global options] command [command options] GOTTY_URL
|
|
|
|
|
2018-04-11 22:55:47 +08:00
|
|
|
AUTHOR:
|
2015-10-11 05:49:22 +08:00
|
|
|
Manfred Touron <https://github.com/moul/gotty-client>
|
|
|
|
|
|
|
|
COMMANDS:
|
2018-04-11 22:55:47 +08:00
|
|
|
help, h Shows a list of commands or help for one command
|
2015-10-11 05:49:22 +08:00
|
|
|
|
|
|
|
GLOBAL OPTIONS:
|
2018-04-11 22:55:47 +08:00
|
|
|
--debug, -D Enable debug mode [$GOTTY_CLIENT_DEBUG]
|
|
|
|
--skip-tls-verify Skip TLS verify [$SKIP_TLS_VERIFY]
|
|
|
|
--use-proxy-from-env Use Proxy from environment [$USE_PROXY_FROM_ENV]
|
|
|
|
--detach-keys value Key sequence for detaching gotty-client (default: "ctrl-p,ctrl-q")
|
|
|
|
--v2 For Gotty 2.0 [$GOTTY_CLIENT_GOTTY2]
|
|
|
|
--ws-origin value, -w value WebSocket Origin URL [$GOTTY_CLIENT_WS_ORIGIN]
|
|
|
|
--help, -h show help
|
|
|
|
--version, -v print the version
|
2015-10-11 05:49:22 +08:00
|
|
|
```
|
|
|
|
|
2015-10-11 05:42:05 +08:00
|
|
|
## Install
|
|
|
|
|
|
|
|
Install latest version using Golang (recommended)
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ go get github.com/moul/gotty-client/cmd/gotty-client
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
Install latest version using Homebrew (Mac OS X)
|
|
|
|
|
|
|
|
```console
|
|
|
|
$ brew install https://raw.githubusercontent.com/moul/gotty-client/master/contrib/homebrew/gotty-client.rb --HEAD
|
|
|
|
```
|
|
|
|
|
|
|
|
or the latest released version
|
|
|
|
|
|
|
|
```console
|
2017-01-20 06:00:50 +08:00
|
|
|
$ brew install https://raw.githubusercontent.com/moul/gotty-client/master/contrib/homebrew/gotty-client.rb
|
2015-10-11 05:42:05 +08:00
|
|
|
```
|
|
|
|
|
2015-09-28 03:57:49 +08:00
|
|
|
## Changelog
|
|
|
|
|
2020-04-27 19:28:35 +08:00
|
|
|
See https://github.com/moul/gotty-client/releases
|
2015-09-28 03:57:49 +08:00
|
|
|
|
2015-08-25 00:51:46 +08:00
|
|
|
## License
|
|
|
|
|
|
|
|
MIT
|