Skip to content

Instantly share code, notes, and snippets.

View cristovao-trevisan's full-sized avatar

Cristóvão Trevisan cristovao-trevisan

View GitHub Profile
@EddieCanales
EddieCanales / rdp.js
Last active April 30, 2019 05:11
How to get screenshots when using node-rdpjs. Write the partial bitmap and render it into the right section of the "buffer" image, then save that to disk whenever you need to.
const screen = require('./screen');
const SCREEN_SIZE = { width : 1364, height : 768 };
async function saveScreen(label) {
await screen.write('screen-'+Date.now()+'-'+(label || '')+'.png');
}
async function createRemoteSession(userName, password, server, rdpScreenSaveInterval=0) {
const clientConfig = {
autoLogin: true,