inz.fi

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6db087d2c8ca49832c7fe5bbbf13acf82f1eaae4
parent 4e29b7f77fb1a6488244c7ac0819b5eec71b2a61
Author: Santtu Lakkala <inz@inz.fi>
Date:   Mon,  2 Jan 2017 09:24:10 +0000

xterm.js + ssh2 + websocket-stream + browserify = webssh

Diffstat:
Aposts/xterm-js-ssh2-websocket-stream-browserify-webssh.md | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/posts/xterm-js-ssh2-websocket-stream-browserify-webssh.md b/posts/xterm-js-ssh2-websocket-stream-browserify-webssh.md @@ -0,0 +1,16 @@ +# xterm.js + ssh2 + websocket-stream + browserify = webssh + +While pondering ideas for a website facelift, there was an idea to have a terminal for easy ssh access. However, none of the readily available options really suited my fancy; [wssh](https://github.com/aluzzardi/wssh) came close, but it was actually doing ssh on the server side, and throwing the raw data inside websockets. + +Fortunately [npm](https://npmjs.com/) is full of nice bits and pieces to build on, and [browserify](http://browserify.org/) makes it quite easy to use most of them in a browser too. + +Long story short, in the end it only required about a [screenful of glue code](https://inz.fi/p/webssh.javascript) to tie in the bits, and voilà . Place the code in webssh.js, grab also the [test html file](https://inz.fi/p/webssh.html5). + + $ npm install xterm ssh2 websocket-stream browserify + $ `npm bin`/browserify webssh.js > bundle.js + $ websockify 8022 localhost:22 + + (You'll need npm and [websockify](https://pypi.python.org/pypi/websockify) for the above). Then launch the html file in your favorite browser, and login. Tune the addresses to your liking. + +There's also a [demo version](http://inz.fi/webssh/), just enter your websocket endpoint (for example ws://localhost:8022), username and password, and on you go. +