A terminal for your browser
A terminal in your browser using node.js and socket.io. Based on Fabrice Bellard's vt100 for jslinux.
$ npm install tty.js
tty.js is an app, but it's also possible to hook into it programatically.
var tty = require'tty.js';var app = ttycreateServershell: 'bash'users:foo: 'bar'port: 8000;appget'/foo'ressend'bar';;applisten;
Configuration is stored in
~/.tty.js as a single
JSON file. An example configuration file looks like:
Usernames and passwords can be plaintext or sha1 hashes.
If tty.js fails to check your terminfo properly, you can force your
xterm-256color by setting
"termName": "xterm-256color" in your config.
tty.js currently has https as an option. It also has express' default basic auth middleware as an option, until it possibly gets something more robust. It's ultimately up to you to make sure no one has access to your terminals but you.
tty.js --port 3000- start and bind to port 3000.
tty.js --daemonize- daemonize process.
tty.js --config ~/my-config.json- specify config file.
The main goal of tty.js is to eventually write a full xterm emulator.
This goal has almost been reached, but there are a few control sequences
not implemented fully.
TERM should render everything fine when set to
tty.js should ultimately be able to work on any unix that implements unix98
forkpty(3). tty.js builds on linux and osx, and it should build
on NetBSD, FreeBSD, and OpenBSD as well. If you have trouble building, please
post an issue.
The distance to go before full xterm compatibility.
Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)