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

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

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

Aposts/ | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/posts/ b/posts/ @@ -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]( came close, but it was actually doing ssh on the server side, and throwing the raw data inside websockets. + +Fortunately [npm]( is full of nice bits and pieces to build on, and [browserify]( 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]( to tie in the bits, and voilà . Place the code in webssh.js, grab also the [test html file]( + + $ npm install xterm ssh2 websocket-stream browserify + $ `npm bin`/browserify webssh.js > bundle.js + $ websockify 8022 localhost:22 + + (You'll need npm and [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](, just enter your websocket endpoint (for example ws://localhost:8022), username and password, and on you go. +