I don't see any reason why implementing SSH in JS wouldn't be possible. You'd need a small server-side part to wrap TCP to WebSockets, but it shouldn't need to touch SSH in any way. Otherwise there shouldn't be really many obstructions. Yes, it might be slower than OpenSSH, but at least it would be secure.
edit: found websockify[1], which should be enough as the server-side component. Now only client-side remains :)
You'd need a small server-side part to wrap TCP to WebSockets, but it shouldn't need to touch SSH in any way.
You probably mean WebSockets to TCP. That kinda kills the client-side concept. That is a neat little library though.
Otherwise there shouldn't be really many obstructions.
The entire point of SSH as opposed to Telnet is that it uses encryption. That means you need to do encryption in JavaScript. Now, I have a number of encryption algorithms that I use on a regular basis in JavaScript for short strings. In theory, you can do it for longer strings. In practice, I suspect you'll grind your browser to a halt.
Would be interesting if somebody else tried it though ...
The entire point of SSH as opposed to Telnet is that it uses encryption.
Exactly. And that's why I'd prefer complete end-to-end encryption instead of giving plaintext to a middleman (or in worst-case scenario to an unknown middleman).
edit: Re: Performance. Best source I could find[1] about encryption with JS claims unoptimized AES implementation doing 30 kB/s in Firefox 3 on 2 GHz Core 2. Certainly enough for interactive use.
edit: found websockify[1], which should be enough as the server-side component. Now only client-side remains :)
[1] https://github.com/kanaka/websockify