Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chjj/node-telnet2
Telnet implementation for node.js, based on node-telnet
https://github.com/chjj/node-telnet2
Last synced: 16 days ago
JSON representation
Telnet implementation for node.js, based on node-telnet
- Host: GitHub
- URL: https://github.com/chjj/node-telnet2
- Owner: chjj
- License: mit
- Created: 2015-09-03T01:52:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-03T01:53:27.000Z (about 9 years ago)
- Last Synced: 2024-10-20T01:14:55.743Z (24 days ago)
- Language: JavaScript
- Size: 191 KB
- Stars: 18
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blessed - node-telnet2 - telnet (Built with blessed)
README
# node-telnet2
A fork of [node-telnet][1], implementing env-vars, term-type, and other
miscellaneous features. It is backwardly compatible with node-telnet.## Example
``` js
var blessed = require('blessed');
var telnet = require('telnet2');telnet({ tty: true }, function(client) {
client.on('term', function(terminal) {
screen.terminal = terminal;
screen.render();
});client.on('size', function(width, height) {
client.columns = width;
client.rows = height;
client.emit('resize');
});var screen = blessed.screen({
smartCSR: true,
input: client,
output: client,
terminal: 'xterm-256color',
fullUnicode: true
});client.on('close', function() {
if (!screen.destroyed) {
screen.destroy();
}
});screen.key(['C-c', 'q'], function(ch, key) {
screen.destroy();
});screen.on('destroy', function() {
if (client.writable) {
client.destroy();
}
});screen.data.main = blessed.box({
parent: screen,
left: 'center',
top: 'center',
width: '80%',
height: '90%',
border: 'line',
content: 'Welcome to my server. Here is your own private session.'
});screen.render();
}).listen(2300);
```## Contribution and License Agreement
If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. ``## License
Copyright (c) 2012-2015, Nathan Rajlich. (MIT Licensed)
Copyright (c) 2015, Christopher Jeffrey. (MIT License)See LICENSE for more info.
[1]: https://github.com/TooTallNate/node-telnet