1 | initial version |
The steps to utilize the node-rdpjs library are as follows:
npm install node-rdpjs
const RDP = require('node-rdpjs');
const rdp = new RDP();
connect
method:rdp.connect({
address: '192.168.0.10',
port: 3389,
user: 'username',
pass: 'password'
});
desktop
event:rdp.on('desktop', (image) => {
// do something with the screen image
});
sendInput
method:rdp.sendInput({keyCode: 13, keyState: 0}); // send the "Enter" key
disconnect
method:rdp.disconnect();
Note: The node-rdpjs library uses the node-rdp library as its backend, which depends on the FreeRDP library. Therefore, you must have FreeRDP installed on your system before using node-rdpjs.