node-rfb2
RFB wire protocol client and server
var rfb = require('rfb2');
var r = rfb.createConnection({
host: '127.0.0.1',
port: 5900,
password: 'secret'
});
r.on('connect', function() {
console.log('successfully connected and authorised');
console.log('remote screen name: ' + r.title + ' width:' + r.width + ' height: ' + r.height);
};
r.pointerEvent(100, 100, 0);
r.keyEvent(40, 0);
r.clipboardUpdate('send text to remote clipboard');
r.on('rect', function(rect) {
switch(rect.encoding) {
rfb.encodings.raw:
rfb.encodings.copyRect:
rfb.encodings.hextile:
rect.on('tile', handleHextileTile);
}
}
r.on('clipboard', function(newPasteBufData) {
console.log('remote clipboard updated!', newPasteBufData);
});
r.on('bell' console.log.bind(null, 'Bell!!'));
r.requestUpdate(false, 0, 0, r.width, r.height);
r.end();
Status:
Ready
- pointer, keyboard, cutText, requestUpdate client messages
- colormap, bell, cutText server messages
- Raw FB update encoding
- pseudoDesktopSize and copyRect pseudo rect updates
- record/replay to/from file
In progress:
- Hextile, encoding support
- Server side protocol
TODO:
- ZRle, RRE, CoRRE, Zlib, Tight encodings
- ARD and MS security types
see also:
https://github.com/substack/node-rfb
preformance
( TODO: benchmark )