Show HN: ssh chat.shazow.net
Hi HN,
I wrote a custom SSH server in Go, give it a try. It uses your terminal user and SSH keys to authenticate implicitly. Instead of getting a shell, you get an IRC-style chatroom with everyone else.
$ ssh chat.shazow.net
If you're getting "Permission denied (publickey)", please use ssh-keygen to create a keypair. Instructions here: https://help.github.com/articles/generating-ssh-keys/SSH is a really cool protocol; it's a lot like HTTP2. This is a demo of one thing you can do with it, but I plan to factor out the code into libraries that will let you build all kinds of experiences that can be used with any SSH client.
The source code is here: https://github.com/shazow/ssh-chat
(Should be reasonably stable and handle thousands of connections, but apologies in advance if it crashes: Try to reconnect in a minute.)
47 comments
[ 5.2 ms ] story [ 112 ms ] thread<3
As far as I can tell, the RSS memory usage of the process has never gone above 15mb.
There is also a way to force your ssh client to disconnect: http://askubuntu.com/questions/29942/how-can-i-break-out-of-...
Edit, although now I can't seem to reconnect.
Can you hook a full ncurses up to this?
Going by my input lag, it looks like all keypresses are sent to the server, can you implement readline somehow or can i configure SSH to buffer input locally? Cook terminal mode or something?
What's pty.go used for?
If i write a line that's longer than my terminal width, it wraps onto a second line, but new incoming messages obscure the first line
Yup! Any ncurses thing should work great. I couldn't find a golang curses lib that doesn't hardcode to stdout except for crypto/ssh/terminal, but it's fairly limited.
> Going by my input lag, it looks like all keypresses are sent to the server, can you implement readline somehow or can i configure SSH to buffer input locally? Cook terminal mode or something?
I believe that's up to your ssh client. There are things like https://mosh.mit.edu/ which try to mask the latency.
> What's pty.go used for?
For bootstrapping the pty request/response. :)
> If i write a line that's longer than my terminal width, it wraps onto a second line, but new incoming messages obscure the first line
Yea, there's a bug with long line reflow, not sure how to fix it. :(
ncurses is overkill nowadays when everything is a (VT100) emulator.
[0] https://github.com/rcr/rirc
This is a bug we had in the hoon chat client on Urbit that has seen various iterations of fixed, not that this is at all helpful, because it is written in hoon it will probably seem like line noise even if I could bisect and show you the commits that fixed it for urbit... But if you want to come to chat on ~doznec, there are about half a dozen people who can translate hoon and probably can explain in plain English what the fix looks like.
It's open source. Install it locally and break it to your heart's content. If you're flooding the public server, you're just ruining it for everyone else.
Yes, there are no spam controls. Yes, there are bugs. This thing was built in a couple of days on my free time, and here I am sharing it with you. Please find bugs locally, fix them, and send a pull request.
Enjoy. :)
Great work!
You can either disable it for a particular session via -a argument:
Or permanently for this host in ~/.ssh/config:(If you'd like to take my word for it, I have no intention on doing this on chat.shazow.net)
We've had some pull requests since then which add colors and other things.
http://danieljanus.pl/hnchatlog.html
The server is restarted every hour so you should be able to access it in a while.
The flood control feature has been added, we are waiting for shazow to wake up and update the binary.