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)
2015-08-25 00:51:46 +08:00
2015-08-28 21:47:26 +08:00
```ruby
2016-03-09 20:57:25 +08:00
┌─────────────────┐
┌──────▶│ /bin/bash │
│ └─────────────────┘
┌──────────────┐ ┌──────────┐
│ │ │ Gotty │
┌───────┐ ┌──▶│ Browser │───────┐ │ │
│ │ │ │ │ │ │ │
│ │ │ └──────────────┘ │ │ │ ┌─────────────────┐
│ Bob │───┤ websockets─▶│ │─▶│ emacs /var/www │
│ │ │ ╔═ ══ ══ ══ ══ ╗ │ │ │ └─────────────────┘
│ │ │ ║ ║ │ │ │
└───────┘ └──▶║ gotty-client ───────┘ │ │
║ │ │
╚═ ══ ══ ══ ══ ╝ └──────────┘
│ ┌─────────────────┐
└──────▶│ 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
2018-04-11 22:59:21 +08:00
### master (unreleased)
2018-05-08 23:48:02 +08:00
* Fix TTY restoring by switching to [`github.com/moby/moby/pkg/term` ](https://github.com/moby/moby/tree/master/pkg/term ) ([#59](https://github.com/moul/gotty-client/pull/59) + ([#60](https://github.com/moul/gotty-client/pull/60) + ([#62](https://github.com/moul/gotty-client/pull/62) ([@Sh4d1](https://github.com/Sh4d1))
2018-04-11 22:59:21 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.7.0...master )
2018-04-11 22:55:47 +08:00
### [v1.7.0](https://github.com/moul/gotty-client/releases/tag/v1.7.0) (2018-04-11)
2017-01-19 12:39:43 +08:00
2017-12-13 23:54:37 +08:00
* Add `--detach-keys` option ([#52](https://github.com/moul/gotty-client/issues/52))
2018-04-11 22:38:36 +08:00
* Cross build on Solaris ([#55](https://github.com/moul/gotty-client/pull/55) ([@dimtion](https://github.com/dimtion))
* Fix terminal resizing issue ([#56](https://github.com/moul/gotty-client/pull/56) ([@byung2](https://github.com/byung2))
* Support for gotty v2.0 ([#58](https://github.com/moul/gotty-client/pull/58) ([@byung2](https://github.com/byung2))
* Support ws-origin (CORS) ([#58](https://github.com/moul/gotty-client/pull/58) ([@byung2](https://github.com/byung2))
2017-01-19 12:39:43 +08:00
2018-04-11 22:55:47 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.6.1...v1.7.0 )
2017-01-19 12:39:43 +08:00
2017-01-19 12:35:41 +08:00
### [v1.6.1](https://github.com/moul/gotty-client/releases/tag/v1.6.1) (2017-01-19)
2016-05-23 22:19:45 +08:00
2017-01-19 12:35:41 +08:00
* Do not exit on EOF ([#45](https://github.com/moul/gotty-client/pull/45)) ([@gurjeet](https://github.com/gurjeet))
2016-05-23 22:19:45 +08:00
2017-01-19 12:35:41 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.6.0...v1.6.1 )
2016-05-23 22:19:45 +08:00
2016-05-23 22:12:38 +08:00
### [v1.6.0](https://github.com/moul/gotty-client/releases/tag/v1.6.0) (2016-05-23)
2016-02-18 18:50:52 +08:00
2016-02-25 00:17:23 +08:00
* Support of `--use-proxy-from-env` (Add Proxy support) ([#36](https://github.com/moul/gotty-client/pull/36)) ([@byung2](https://github.com/byung2))
2016-05-23 22:11:15 +08:00
* Add debug mode ([#18](https://github.com/moul/gotty-client/issues/18))
* Fix argument passing ([#16](https://github.com/moul/gotty-client/issues/16))
* Remove warnings + golang fixes and refactoring ([@QuentinPerez](https://github.com/QuentinPerez))
2016-02-18 18:50:52 +08:00
2016-05-23 22:12:38 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.5.0...v1.6.0 )
2016-02-18 18:50:52 +08:00
2016-02-18 18:31:13 +08:00
### [v1.5.0](https://github.com/moul/gotty-client/releases/tag/v1.5.0) (2016-02-18)
2015-12-10 02:46:23 +08:00
2016-02-18 18:19:21 +08:00
* Add autocomplete support ([#19](https://github.com/moul/gotty-client/issues/19))
2016-01-04 19:28:50 +08:00
* Switch from `Party` to `Godep`
2015-12-30 14:18:54 +08:00
* Fix terminal data being interpreted as format string ([#34](https://github.com/moul/gotty-client/pull/34)) ([@mickael9](https://github.com/mickael9))
2015-12-10 02:46:23 +08:00
2016-02-18 18:31:13 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.4.0...v1.5.0 )
2015-12-10 02:46:23 +08:00
2015-12-10 02:25:55 +08:00
### [v1.4.0](https://github.com/moul/gotty-client/releases/tag/v1.4.0) (2015-12-09)
2015-10-28 03:09:28 +08:00
2015-11-19 07:15:26 +08:00
* Remove solaris,plan9,nacl for `.goxc.json`
2015-11-06 07:02:51 +08:00
* Add an error if the go version is lower than 1.5
2015-11-02 02:31:46 +08:00
* Flexible parsing of the input URL
2015-11-02 02:32:07 +08:00
* Add tests
2015-12-10 01:58:57 +08:00
* Support of `--skip-tls-verify`
2015-10-28 03:09:28 +08:00
2015-12-10 02:25:55 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.3.0...v1.4.0 )
2015-10-28 03:09:28 +08:00
2015-10-28 03:07:26 +08:00
### [v1.3.0](https://github.com/moul/gotty-client/releases/tag/v1.3.0) (2015-10-27)
2015-10-24 00:02:23 +08:00
2015-10-26 20:07:17 +08:00
* Fix `connected` state when using `Connect()` + `Loop()` methods
2015-10-26 20:00:19 +08:00
* Add `ExitLoop` which allow to exit from `Loop` function
2015-10-24 00:02:23 +08:00
2015-10-28 03:09:28 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.2.0...v1.3.0 )
2015-10-24 00:02:23 +08:00
2015-10-23 23:10:54 +08:00
### [v1.2.0](https://github.com/moul/gotty-client/releases/tag/v1.2.0) (2015-10-23)
2015-10-11 05:27:25 +08:00
2015-10-23 23:09:03 +08:00
* Removed an annoying warning when exiting connection ([#22](https://github.com/moul/gotty-client/issues/22)) ([@QuentinPerez](https://github.com/QuentinPerez))
* Add the ability to configure alternative stdout ([#21](https://github.com/moul/gotty-client/issues/21)) ([@QuentinPerez](https://github.com/QuentinPerez))
* Refactored the goroutine system with select, improve speed and stability ([@QuentinPerez](https://github.com/QuentinPerez))
2015-10-13 23:03:29 +08:00
* Add debug mode (`--debug`/`-D`) ([#18](https://github.com/moul/gotty-client/issues/18))
* Improve error message when connecting by checking HTTP status code
2015-10-13 00:07:50 +08:00
* Fix arguments passing ([#16](https://github.com/moul/gotty-client/issues/16))
2015-10-23 23:09:03 +08:00
* Dropped support for golang< 1.5
* Small fixes
2015-10-11 05:27:25 +08:00
2015-10-23 23:10:54 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.1.0...v1.2.0 )
2015-10-11 05:27:25 +08:00
2015-10-13 00:07:50 +08:00
### [v1.1.0](https://github.com/moul/gotty-client/releases/tag/v1.1.0) (2015-10-10)
2015-09-28 03:57:49 +08:00
2015-10-11 05:24:41 +08:00
* Handling arguments + using mutexes (thanks to [@QuentinPerez ](https://github.com/QuentinPerez ))
* Add logo ([#9](https://github.com/moul/gotty-client/issues/9))
2015-10-11 05:10:09 +08:00
* Using codegansta/cli for CLI parsing ([#3](https://github.com/moul/gotty-client/issues/3))
2015-10-11 05:08:23 +08:00
* Fix panic when running on older GoTTY server ([#13](https://github.com/moul/gotty-client/issues/13))
2015-09-28 03:57:49 +08:00
* Add 'homebrew support' ([#1](https://github.com/moul/gotty-client/issues/1))
* Add Changelog ([#5](https://github.com/moul/gotty-client/issues/5))
2015-09-28 04:27:37 +08:00
* Add GOXC configuration to build binaries for multiple architectures ([#2](https://github.com/moul/gotty-client/issues/2))
2015-09-28 03:57:49 +08:00
2015-10-11 05:25:48 +08:00
[full commits list ](https://github.com/moul/gotty-client/compare/v1.0.1...v1.1.0 )
2015-09-28 03:57:49 +08:00
### [v1.0.1](https://github.com/moul/gotty-client/releases/tag/v1.0.1) (2015-09-27)
* Using party to manage dependencies
[full commits list ](https://github.com/moul/gotty-client/compare/v1.0.0...v1.0.1 )
### [v1.0.0](https://github.com/moul/gotty-client/releases/tag/v1.0.0) (2015-09-27)
Compatible with [GoTTY ](https://github.com/yudai/gotty ) version: [v0.0.10 ](https://github.com/yudai/gotty/releases/tag/v0.0.10 )
#### Features
* Support **basic-auth**
* Support **terminal-(re)size**
* Support **write**
* Support **title**
* Support **custom URI**
[full commits list ](https://github.com/moul/gotty-client/compare/cf0c1146c7ce20fe0bd65764c13253bc575cd43a...v1.0.0 )
2015-08-25 00:51:46 +08:00
## License
MIT
2017-07-20 16:20:27 +08:00
2018-10-19 16:54:24 +08:00
[![FOSSA Status ](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client.svg?type=large )](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmoul%2Fgotty-client?ref=badge_large) [![GuardRails badge ](https://badges.production.guardrails.io/moul/gotty-client.svg )](https://www.guardrails.io)