yudai / gotty Goto Github PK
View Code? Open in Web Editor NEWShare your terminal as a web application
License: MIT License
Share your terminal as a web application
License: MIT License
2015/08/19 20:56:32 New client connected: <my ip>:26736
2015/08/19 20:56:32 Failed to upgrade connection
Getting this error sometimes, only on Chrome. Firefox runs it well.
Client shows only a blank page.
Yesterday I had tried it out already and everything was fine.
Gotty is very awesome.
When I set ' --once' , the console can not reconnect.
So I cannot use gotty in a unstable network with once feature.
Thanks .
For environments where people use w3m and cannot run hterm,
Terminal A: gotty -w tmux new -A -s foo
Then,
Terminal B gotty -x
It would be great if terminal B sends a broadcast packet and automatically discovers terminal A.
Very nice project!
I was planning to try it, and my first idea has been to use it inside Docker, for security reasons.
You suggest to launch docker via gotty, but I think this is a vulnerability.
As discussed in the past on docker security, it might be possible to crash the docker container, allowing to execute commands on the host.
Wouldn't it be better to launch docker, then run gotty INSIDE docker?
Copy and paste wold be an awesome improvement!
Thank you!
It would be nice to be able to use custom fonts. I added this with the raw one, it was pretty straight forward if I remember correctly.
Could it be possible to add Linux ARMHF (Raspberry Pi) releases ?
Thanks !
Thanks for this apps, run fine on Qnap NAS QPKG is available here
http://forum.qnap.com/viewtopic.php?f=320&t=113304
but i wonder why Midnight commander stay frozen.. not sure how to debug
I would be nice if it's possible to deliver parameters or information about the client to the command to be executed when client connects to gotty.
Example1:
gotty /opt/cmd
http://hostname:8080/?arg1=foo&arg2=bar => gotty will execute /opt/cmd arg1=foo arg2=bar
In terms of security reasons it would be reasonable if it's possible to limit what arguments should be delivered and what data could be into them (only digits / only A-Z)?
Example2:
gotty /opt/cmd %CLIENT_IP_ADDRESS%
192.168.1.10 connects to http://hostname:8080/ => gotty will execute /opt/cmd 192.168.1.10
For me, if I run gotty --once -w vim
then connect in the browser, then close the browser tab, I find that gotty is still running.
Hi Yudai,
can it be possible to set authentification using the uid 0 user for example.
this could allow Qnap users to log with the admin user (no root on qnap) set on their box, instead to set a custom user/password
I think it could be a good enhancement for Gotty.
May be you use go-bindata, even through this program can work, but hterm.js still not found.
Hi, my use case is I'm trying to provide an in-browser SSH client, however I'll be spawning up the gotty process when the request comes in and I want to kill it when the user exits ssh. What I'm using is:
gotty -w ssh [email protected]
The problem currently I'm seeing is, when I go to browser and exit the ssh prompt (with exit
command for instance), the gotty
process stays alive and keeps accepting connections and new connections cause ssh command above to be restarted.
What I do need instead is, gotty
server to quit when user quits by exiting the process so that I can garbage collect resources and next time user visits my service (say, http://example.com/ssh/[email protected]
) I will spawn another gotty server.
@yudai does it sound like a good proposal to have an argument that makes the gotty server quit once the executed process quits (rather than staying alive and re-execing the specified command when a new request comes in)?
To reproduce:
$ gotty tmux new -A -s gotty top
Connect via tmux:
tmux att -t gotty
localhost:8080
to view the terminal in a browserclear
to clear the terminal bufferclear
ed reappeargotty installed by instruction by the brew.
keys generated by instruction.
at start gotty logs this issue:
crypto/tls: failed to parse certificate PEM data
It would be helpful if the IP addresses of the clients could be part of the logging. Working on an educational application for shared terminal window and it would help with debugging.
There are many, many services which supply free DNS and provide an API to register them.
We should evaluate those and pick a few that are safe to use and preferably open sourced with a permissive license.
This will allow us to share the terminal outside of the current network we're on.
Suggestion: "GoTTY - #{command} (#{hostname})"
Saw a crash when a second client connected to gotty into a tmux session holding htop
(i.e., ran via gotty tmux attach -t gotty
to show it to a coworker, 'cause this is pretty awesome).
$ tmux new-session -s gotty htop
…
$ gotty tmux attach -t gotty
2015/08/17 07:59:02 Sever is running at :8080, command: tmux attach -t gotty
2015/08/17 07:59:04 New client connected: 10.0.3.89:58751
2015/08/17 07:59:26 New client connected: 10.0.3.211:63808
panic: runtime error: slice bounds out of range
goroutine 5 [running]:
github.com/yudai/utf8reader.(*UTF8Reader).Read(0xc82003ef58, 0xc82021c800, 0x400, 0x400, 0x400, 0x0, 0x0)
GOPATH/src/github.com/yudai/utf8reader/utf8reader.go:47 +0x2ca
github.com/yudai/gotty/app.(*App).generateHandler.func1.1(0xc8201e1e30, 0xc820032018, 0xc820112460, 0xc8201101e0)
GOPATH/src/github.com/yudai/gotty/app/app.go:89 +0x1f3
created by github.com/yudai/gotty/app.(*App).generateHandler.func1
GOPATH/src/github.com/yudai/gotty/app/app.go:103 +0x5d3
… other goroutines behaving normally …
Unfortunately haven't been able to reproduce it, so possibly a fluke. Figured I'd open an issue and if I come up on other details I'll amend the issue.
when i compiled source code,found code err
mkdir bindata
make: *** No rule to make target `libapps/hterm/js/*.js', needed by `bindata/hterm.js'. Stop.
The alt key ("option key") on OS X gets mapped to the meta key, making it impossible to write e.g. "@" (on my keyboard layout "@" is alt+2) and a range of other characters (©, £, $, ∞, §, |, [, ], etc.).
OS X 10.10.5, Safari 8.0.8 issue: "failed: Unexpected response code: 401"
Work very well in OS X 10.10.5, Firefox 40.0.3
Hi,
Is it possible to have a 32 bit binary version in Release archive ?
Thanks
When doing dumb stuff like cat /dev/random or cat on binaries which yield unprintable characters (and may screw up a terminal under "normal" circumstances ) lead to a disconnection. This is especially bad when byobu (tmux wrapper) runs in the background, which makes reconnection impossible ;-).
I don't know if this is fixable, but I thought worth mentioning.
It would be nice if you could disable the resizing feature. Overlapping areas could be accessed via a scrollbar inside the browser.
mbp ~ → gotty -v
gotty version 0.0.9
mbp ~ → cat .gotty
// Listen at port 9000 by default
port = "9000"
// Enable TSL/SSL by default
//enable_tls = true
// hterm preferences
// Smaller font and a little bit bluer background color
preferences {
font_size = 5,
background_color = "rgb(16, 16, 32)"
}
mbp ~ → gotty bash
2015/09/01 21:31:19 Loading config file at: /Users/paul/.gotty
2015/09/01 21:31:19 Server is starting with command: bash
2015/09/01 21:31:19 URL: http://[::1]:8080/
2015/09/01 21:31:19 URL: http://127.0.0.1:8080/
2015/09/01 21:31:19 URL: http://[fe80::1]:8080/
2015/09/01 21:31:19 URL: http://[fe80::7a31:c1ff:fed1:584]:8080/
2015/09/01 21:31:19 URL: http://192.168.88.157:8080/
2015/09/01 21:31:19 URL: http://192.168.99.1:8080/
2015/09/01 21:31:19 URL: http://192.168.50.1:8080/
2015/09/01 21:31:19 URL: http://172.16.82.1:8080/
2015/09/01 21:31:19 URL: http://172.16.0.1:8080/
Hi Master Yudai
the actual binary release is for ARM6, possible to have ARM5 version, i am sure some qnap user will love your application
thanks a lot ,
So that it's more noticeable.
Adding a "-d" flag or something similar to run gotty as a daemon process will prevent taking up the terminal.
gotty --random-url --permit-write top --addr 127.0.0.1
When I go to the page. I get 404 not found.
Hi, i am trying to install this app in Windows, but getting the following error :
D:\projects>go get github.com/yudai/gotty
# github.com/kr/pty
D:\go_workspace\src\github.com\kr\pty\ioctl.go:6: undefined: syscall.SYS_IOCTL
D:\go_workspace\src\github.com\kr\pty\ioctl.go:6: not enough arguments in call to syscall.Syscall
D:\go_workspace\src\github.com\kr\pty\run.go:21: unknown syscall.SysProcAttr field 'Setctty' in struct literal
D:\go_workspace\src\github.com\kr\pty\run.go:21: unknown syscall.SysProcAttr field 'Setsid' in struct literal
D:\go_workspace\src\github.com\kr\pty\util.go:26: undefined: syscall.SYS_IOCTL
D:\go_workspace\src\github.com\kr\pty\util.go:28: undefined: syscall.TIOCGWINSZ
D:\go_workspace\src\github.com\kr\pty\util.go:30: not enough arguments in call to syscall.Syscall
Is this a Windows specific issue?
It would be nice if gotty
would tell the webbrowser to automatically reload the page if an old session was finished/killed and a new one was started on the same port. Should be easy to implement on the client side.
Keep up the good work! This package is a big one for me! 👍
Hello,
I was searching for this handy software and this first link http://gotty.io/ appeared.
Could you consider to change name to avoid future confusion like this one? http://gotty.io is older than this project.
Thanks.
It would be nice if there are URLs in the screen the gotty / JS could convert them into links which will open into new window.
The code should be aware if the URL continues into the next line like (typical situation in chat window):
SomeNick: Check this out: http://www.foo.com/bar/dir/something/inde
x.php that's so cool!
OtherNick: yes!
I've ran into this while showing this tool to my collegue. When ever I would run the command kitchen converge
The first few people to connect are actually good, but then at some point every refresh/new connection cause the command the be ran gain.
EDIT: it seems to stop at 2... The first ps is at start with me watching, then the second one is after my collegue joined.
➜ ~ gotty -w top
2015/08/23 12:20:01 Server is starting with command: top
2015/08/23 12:20:01 URL: http://::1:8080/
2015/08/23 12:20:01 URL: http://127.0.0.1:8080/
2015/08/23 12:20:01 URL: http://fe80::1:8080/
2015/08/23 12:20:01 URL: http://fe80::a65e:60ff:fecc:5cc7:8080/
2015/08/23 12:20:01 URL: http://192.168.0.113:8080/
2015/08/23 12:20:01 URL: http://fe80::6048:20ff:fea9:ec6f:8080/
2015/08/23 12:20:01 URL: http://192.168.99.1:8080/
From what observe on Chrome and Safari on OS X is browsers can't open addrs like http://::1:8080/
or http://fe80::a65e:60ff:fecc:5cc7:8080/
at all. Maybe the program should just print IPv4 ones?
When setting 'color-palette-overrides' I get the following error in the javascript debug window (firefox)
[15:34:58.042] "Preference color-palette-overrides is not an array or object: {'0':'#073642','1':'#dc322f','2':'#859900','3':'#b58900','4':'#268bd2','5':'#d33682','6':'#2aa198','7':'#eee8d5','8':'#002b36','9':'#cb4b16','10':'#586e75','11':'#657b83','12':'#839496','13':'#6c71c4','14':'#93a1a1','15':'#fdf6e3'}"
In my .gotty file I intered
color_palette_overrides = "{'0':'#073642','1':'#dc322f','2':'#859900','3':'#b58900','4':'#268bd2','5':'#d33682','6':'#2aa198','7':'#eee8d5','8':'#002b36','9':'#cb4b16','10':'#586e75','11':'#657b83','12':'#839496','13':'#6c71c4','14':'#93a1a1','15':'#fdf6e3'}"
Within the Preference object.
PS: I'm excited 😄
gotty -w vim
Default SSL support by the server must be required.
I know, it's dangerous enough.
Allow send only arguments like run gotty --permit-arguments tailf
then, access http://server.exmple.com:8080/%2Fvar%2Flog%2Fsyslog
(/var/log/syslog).
(Need to take care of shell meta characters not to permit using pipe and redirects)
Freedom mode like gotty --freedom
then, access http://server.example.com:8080/tailf+%2Fvar%2Flog%2Fsyslog
.
Please make this tool installable via Homebrew. 👍
Has anyone managed to successfully get Gotty working through Apache?
I can't resolve the issue of WebSocket not initializing:
Request URL:wss://.../console/ws
Request Method:GET
Status Code:403 Forbidden
The Gotty log:
2015/08/18 12:46:08 New client connected: 127.0.0.1:33020
2015/08/18 12:46:08 Failed to upgrade connection
The Apache Configuration:
<VirtualHost *:443>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile ...
SSLCertificateKeyFile ...
SSLCertificateChainFile ...
ServerName ...
ProxyPass /console/ws ws://localhost:8075/ws
ProxyPassReverse /console/ws ws://localhost:8075/ws
ProxyPass /console http://localhost:8075
ProxyPassReverse /console http://localhost:8075
<Location /console>
AuthType Basic
AuthName "Console"
AuthUserFile /etc/apache2/console.passwd
Require valid-user
Order allow,deny
Allow from all
</Location>
Any suggestions are welcomed, I tried everything I could think of.
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
As I mentioned in another issue, I'm using GoTTY as a bridge for my telnet BBS, but the colors are a bit off for VGA textmode artwork.
Awesome work, anyway! I really appreciate the app.
URL generation for something like an authentication alternative.
Add an option to generate URLs like:
https://host:8080/nairj3gnw5ja39r23
The ability for web clients to send input to the gotty'd process is awesome, but it would also be excellent to allow the user who is hosting the gotty process to use STDIN to "screencast" to consumers.
Ideal flow:
gotty nano /tmp/some/file
Gotty starts, and the tty used to start gotty acts exactly as if the command had been run without gotty. The user can "screencast" their input and results to web consumers - without web consumers necessarily being able to control the process.
Running "make" against the provided makefile immediately fails with:
make: *** No rule to make target `libapps/hterm/js/*.js', needed by `bindata/hterm.js'. Stop.
libapps/ is an empty directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.