citronneur / node-rdpjs Goto Github PK
View Code? Open in Web Editor NEWRemote Desktop Protocol for Node.js
License: GNU General Public License v3.0
Remote Desktop Protocol for Node.js
License: GNU General Public License v3.0
using the unicode 91
, or non-unicode 0xE05B
or 0x5B
all fail to act as if the Windows key has been sent. Sending a combination of ctrl (0x001D
) + esc (0x0001
) brings up the windows menu but since it doesn't act as a windows key, it cant be used for other shortcuts
Hi All,
I have setup node-rdpjs using mstsc.js and is able to connect RDP to remote machine. However, when I play any audio/video on that machine, I cannot hear the audio on my browser.
Has anyone faced this issue and can help me?
With decompress set to true
. I'm currently seeing a 64x64 pixel/32-bit bitmap every 300-500ms or so. With no decompression, I see about 1838. I'm currently running node v0.12.7 ... Is something potentially misconfigured?
Is there any way to implement NLA Authentication security layer? It is keeping many applications from working properly.
You had it in your roadmap for a long time, I guess it should be finally implemented.
Please is there anything to help with?
Regards and thanks for that beautiful repo!
Support for copy + paste would be nice. e.g. https://msdn.microsoft.com/en-us/library/cc241066.aspx. Sample implementations can be found at:
@citronneur any quick pointers if I give implementing this a shot?
The NPM tarball off this package was not updated after commit de7113a which causes npm install
to fail on recent versions of node due to an outdated bignum dependency.
It would be nice if this package could be republished on NPM to fix this build error.
When my node is 8.9.3, this project is ok. But while my node is 10.16.0, it cannot work. And the error log is like this:
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:182:27)
Could you add docs for rdp server
New to NodeJS. Please excuse me if this is a simple error. Installed bignum globally and for the project yet still getting the message "Cannot find module './build/Release/bignum'". Running Atom electron on Yosemite.
rdp Win2003 ,show error:
[node-rdpjs] ERROR: NODE_RDP_PROTOCOL_X224_NEG_FAILURE()
Error
at new ProtocolError (file:///C:/Users/Administrator/Hozz5/app/main.js:138510:9)
at Client.recvConnectionConfirm (file:///C:/Users/Administrator/Hozz5/app/main.js:156822:10)
at TPKT. (file:///C:/Users/Administrator/Hozz5/app/main.js:156803:9)
at TPKT.g (events.js:286:16)
at emitOne (events.js:96:13)
at TPKT.emit (events.js:188:7)
at TPKT.recvData (file:///C:/Users/Administrator/Hozz5/app/main.js:137623:8)
at BufferLayer. (file:///C:/Users/Administrator/Hozz5/app/main.js:137614:9)
at BufferLayer.g (events.js:286:16)
at emitOne (events.js:96:13)
at BufferLayer.emit (events.js:188:7)
at BufferLayer.recv (file:///C:/Users/Administrator/Hozz5/app/main.js:137821:9)
at Socket. (file:///C:/Users/Administrator/Hozz5/app/main.js:137771:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
Some system configurations seem to run two RDP connections with the same code -- calling all of the callbacks twice.
Specifically nodejs 0.12.7+
and 4.0+
connecting to Windows Server 2008 R2 from ubuntu 14.04 show this issue.
I did not see the same behavior on Mac, or when connecting to Windows 8 from the same ubuntu machine.
Can someone point me out where I can find some info about connecting to admin session / console?
$ npm i -g node-rdpjs
$ npm i node-rdpjs
[node-rdpjs] ERROR: undefined(crypto.createCredentials is not a function)
TypeError: crypto.createCredentials is not a function
at BufferLayer.startTLS (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/core/layer.js:127:39)
at Client.recvConnectionConfirm (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/protocol/x224.js:245:28)
at TPKT.<anonymous> (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/protocol/x224.js:202:8)
at Object.onceWrapper (events.js:276:13)
at TPKT.emit (events.js:188:13)
at TPKT.recvData (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/protocol/tpkt.js:110:7)
at BufferLayer.<anonymous> (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/protocol/tpkt.js:101:8)
at Object.onceWrapper (events.js:276:13)
at BufferLayer.emit (events.js:188:13)
at BufferLayer.recv (/Users/xxx/Downloads/mstsc.js/node_modules/node-rdpjs/lib/core/layer.js:92:8)
Hi,
Using the node-rdpjs, is it possible to connect to a "RemoteApp" inside RDS (remote desktop services) ?
Thanks
Thanks for this great module! I have a question about using it for another task.
How difficult is it to copy files from the remote connection to local machine through RDP?
In Microsoft RDP clients there is the feature to share local folders into the remote machine and then copy files.
it is possible to configure clipboard to be enable? Unfortunately copy paste don't work.
Is there a way to launch a remote app or executable after connection or while the client is being created through the config options?
I've been working with this for a solid 4 hours, and I can not figure it out.
The best I can do is an array of the pixel values .
bug? or how pixel ^ last pixel....
so jpg change pixel image to jpg send client
how set
I run statement install, it shows out many error : http://prntscr.com/8k8hxb
Can you help me fix step by step each error ? Or show me some reasons !
Normally, others nodejs module I install easily, I never got some above errors
Thanks so much !
How do we ignore the certificates error
My use case is I have a local directory e.g. C:/tmp
I want to be able to access this directory from within the remotely connected PC. Is this possible?
Great work by the way!
I'm facing this error when i try to connect to server using remote desktop...
CLIENT DATA RECEIVED:{"label":"infos","ip":"server2008r2tes","port":3389,"screen":{"width":1093,"height":900},"domain":"","username":"","password":"","locale":"it-IT"}
C:\nodeworkspace\pla…\server\mstsc.js:91 activating rdp connection...
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] INFO: screen 1093x900
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] INFO: english keyboard layout
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] INFO: connect to server2008r2tes:3389
C:\nodeworkspace\pla…\server\mstsc.js:53 Setting remote description [object Object]
C:\nodeworkspace\pla…\server\mstsc.js:53 Data channel connection success
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] INFO: SSL standard security selected
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] WARN: Error: unable to verify the first certificate
C:\nodeworkspace\pla…server\mstsc.js:108 RDP-CONNECT EVENT
C:\nodeworkspace\pla…server\mstsc.js:115 RDP-RENDER BITMAP EVENT
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] INFO: MCS DISCONNECT_PROVIDER_ULTIMATUM
C:\nodeworkspace\pla…\lib\core\log.js:30 [node-rdpjs] ERROR: ECONNRESET(read ECONNRESET)
Could be this errore related to "unable to verify the first cerfificate" error?
Thanks in advance
I'm creating an electron app and one of the EPIC in our roadmap is to activate an remote access to the host that run our application.
Unfortunately i cannot find an example of how to create a server with method createServer( [options{}]).
Can you supply please?
I am facing issue while connecting the windows server thru node-rdpjs. Could any one please help me.
I am getting following error whenever i try to make a simple rdp connection.
[node-rdpjs]` INFO: screen 800x600
[node-rdpjs] INFO: english keyboard layout
[node-rdpjs] INFO: connect to 192.168.2.179:3389
[node-rdpjs] INFO: SSL standard security selected
(node) crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
[node-rdpjs] ERROR: ECONNRESET(socket hang up)
Error: socket hang up
at SecurePair.options.ssl.onclienthello.ssl.onnewsession.ssl.onocspresponse.SecurePair.error (_tls_legacy.js:821:23)
at EncryptedStream.CryptoStream._done (_tls_legacy.js:469:22)
at CleartextStream.read as _read
at CleartextStream.Readable.read (_stream_readable.js:336:10)
at EncryptedStream.onCryptoStreamFinish (_tls_legacy.js:111:47)
at EncryptedStream.g (events.js:260:16)
at emitNone (events.js:72:20)
at EncryptedStream.emit (events.js:166:7)
at finishMaybe (_stream_writable.js:481:14)
at endWritable (_stream_writable.js:491:3)
D:\NodeApp\test\app.js:18
throw err;
^
Error: socket hang up
at SecurePair.options.ssl.onclienthello.ssl.onnewsession.ssl.onocspresponse.SecurePair.error (_tls_legacy.js:821:23)
at EncryptedStream.CryptoStream._done (_tls_legacy.js:469:22)
at CleartextStream.read as _read
at CleartextStream.Readable.read (_stream_readable.js:336:10)
at EncryptedStream.onCryptoStreamFinish (_tls_legacy.js:111:47)
at EncryptedStream.g (events.js:260:16)
at emitNone (events.js:72:20)
at EncryptedStream.emit (events.js:166:7)
at finishMaybe (_stream_writable.js:481:14)
at endWritable (_stream_writable.js:491:3)
var rdp = require('node-rdpjs');
var client = rdp.createClient({
domain : 'my_domain',
userName : 'my_username',
password : 'my_password',
enablePerf : true,
autoLogin : true,
decompress : false,
screen : { width : 800, height : 600 },
locale : 'en',
logLevel : 'INFO'
}).on('connect', function () {
}).on('close', function() {
}).on('bitmap', function(bitmap) {
}).on('error', function(err) {
}).connect('XXX.XXX.XXX.XXX', 3389);
Where to paste it?
Sorry if this isn't a bug, but I wasn't able to figure out if my usage was incorrect given the README:
var rdp = require('node-rdpjs'),
config = require('./config');
var client = rdp.createClient({
domain : config.rdpDomain,
userName : config.rdpUsername,
password : config.rdpPassword,
enablePerf : true,
autoLogin : true,
decompress : false,
screen : { width : 1200, height : 1024 },
locale : 'en',
logLevel : 'INFO'
}).on('connect', function () {
console.log("Connected");
setTimeout(function () {
console.log("closing");
client.close();
}, 3000);
}).on('close', function() {
}).on('bitmap', function(bitmap) {
}).on('error', function(err) {
}).connect(config.rdpHost, config.rdpPort);
Generates the following output:
[15:00][Michaels-MacBook-Pro:rdp-collection]$ node index.js
[node-rdpjs] INFO: screen 1200x1024
[node-rdpjs] INFO: english keyboard layout
[node-rdpjs] INFO: connect to 192.168.50.201:3389
[node-rdpjs] INFO: SSL standard security selected
[node-rdpjs] WARN: Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
Connected
closing
[node-rdpjs] ERROR: ECONNRESET(read ECONNRESET)
Error: read ECONNRESET
at errnoException (net.js:904:11)
at TCP.onread (net.js:558:19)
[node-rdpjs] ERROR: ECONNRESET(read ECONNRESET)
Error: read ECONNRESET
at errnoException (net.js:904:11)
at TCP.onread (net.js:558:19)
[15:01][Michaels-MacBook-Pro:rdp-collection]$
Am I doing something unexpected here that causes an unclean close? Would any other debugging info be helpful?
How i can understand, if i connected with login and password was successful?
Hello Bro. I have some problems to conect to rdp without SSL with node-rdpjs I get ERROR:
[4168:0226/114735.999108:INFO:CONSOLE(30)] "[node-rdpjs] INFO: SSL standard security selected", source: /Users/jet/Projects/man_ovd_client/node_modules/node-rdpjs/lib/core/log.js (30)
[4168:0226/114736.232635:INFO:CONSOLE(30)] "[node-rdpjs] WARN: Error: unable to verify the first certificate", source: /Users/jet/Projects/man_ovd_client/node_modules/node-rdpjs/lib/core/log.js (30)
[4168:0226/114737.273272:INFO:CONSOLE(30)] "[node-rdpjs] INFO: new license request", source: /Users/jet/Projects/man_ovd_client/node_modules/node-rdpjs/lib/core/log.js (30)
[4168:0226/114738.275318:INFO:CONSOLE(30)] "[node-rdpjs] INFO: MCS DISCONNECT_PROVIDER_ULTIMATUM", source: /Users/jet/Projects/man_ovd_client/node_modules/node-rdpjs/lib/core/log.js (30)
[4168:0226/114738.365424:INFO:CONSOLE(30)] "[node-rdpjs] ERROR: ECONNRESET(read ECONNRESET)
Can you help me?
Thanks
winserver 2016 throw error NODE_RDP_PROTOCOL_X224_NEG_FAILURE() , but winserver 2019 can work
I am very much excited to see how you are going to implement it.
mac os 10.14.2
$ brew update;brew upgrade;brew cleanup
$ node -v
v10.10.0
$ npm -v
6.4.1
[node-rdpjs] INFO: SSL standard security selected
(node:50011) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
(node:50011) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.TLSSocket instead.
Same issue as
citronneur/mstsc.js#2
node-rdpjs does not have an updated copy of rle.js
but should given the bug fixes in rle.c
Error: Failure code:2 (see https://msdn.microsoft.com/en-us/library/cc240507.aspx)
at new ProtocolError (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\core\error.js:40:8)
at Client.recvConnectionConfirm (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\protocol\x224.js:221:9)
at TPKT. (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\protocol\x224.js:202:8)
at Object.onceWrapper (events.js:300:26)
at TPKT.emit (events.js:210:5)
at TPKT.recvData (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\protocol\tpkt.js:110:7)
at BufferLayer. (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\protocol\tpkt.js:101:8)
at Object.onceWrapper (events.js:300:26)
at BufferLayer.emit (events.js:210:5)
at BufferLayer.recv (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\core\layer.js:91:8)
at Socket. (C:\Users\QG46159\AppData\Local\Programs\node_modules\node-rdpjs-2\lib\core\layer.js:41:9)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:308:12)
at readableAddChunk (_stream_readable.js:289:11)
at Socket.Readable.push (_stream_readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
[2020-10-22 16:22:54.299] [info] connection closed
bug, can't works in iframe sometimes. can't type any words
I see there is NLA information in the Roadmap. But the changes in the code have not been noticed for a long time. Want to know the project is still alive? Will there be updates for this feature?
Thanks in advance.
I have Windows 10
node v4.2.0
Microsoft Visual Studio 2013 Express
When try to install module using this command:
npm install node-rdpjs --msvs_version=2013 --build-from-source
i got this error:
bignum.cc
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winsock2.h(882): fatal error C1083: Impossibile aprire il file inclu
sione 'qos.h': No such file or directory [D:\mstsc.js\node_modules\bignum\build\bignum.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe
failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\pippo\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\pippo\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build"
gyp ERR! cwd D:\mstsc.js\node_modules\bignum
gyp ERR! node -v v4.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN EPACKAGEJSON [email protected] license should be a valid SPDX license expression
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\pippo\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "node-rdpjs" "--msvs_version=2013" "--build-from-source"
npm ERR! node v4.2.0
npm ERR! npm v3.3.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp configure build'.
npm ERR! This is most likely a problem with the bignum package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls bignum
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\mstsc.js\npm-debug.log
Please, help me
I'm currently getting a 'NODE_RDP_PROTOCOL_X224_NEG_FAILURE' trying to connect to my RDP server. This happens when trying to connect to (what I believe to be) a default setup Windows 8.1 Pro RDP server.
When looking at the result of the message with the error -- I see, based on https://msdn.microsoft.com/en-us/library/cc240507.aspx, that I have the following error
code 5 or: "The server requires that the client support Enhanced RDP Security (section 5.4) with CredSSP (section 5.4.5.2)."
Is this a known issue or just not supported yet? If this isn't supported yet, should a more detailed unsupported error be shown by the node-rdpjs?
Not a bug/ more a feature request.
When hitting known error conditions such as 'NODE_RDP_PROTOCOL_X224_NEG_FAILURE' at https://github.com/citronneur/node-rdpjs/blob/master/lib/protocol/x224.js#L221 -- it would be helpful to also include the failure code (such as those at https://msdn.microsoft.com/en-us/library/cc240507.aspx).
It would help usability/ debugging.
Hi I have tried to search on google about how I can seamlessly connect to windows machine through RDP but haven't got any hint.
Here is scenario for User :
I have seen this video tutorial about who actually it is done in windows.
https://www.youtube.com/watch?v=g30RWJoqONI
Any help / hint is appreciated.
Thank you
I'm using the packge from a nodejs application , and it doesn't connect to the remote deskrop and I get this error in the console :
[node-rdpjs] ERROR: ETIMEDOUT(connect ETIMEDOUT 106.162.16.143:9602)
Error: connect ETIMEDOUT 106.162.16.143:9602
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
here is the config I'm using :
rdp.createClient({
domain : '106.162.16.143:9602',
userName : 'username',
password : 'password',
enablePerf : true,
autoLogin : true,
decompress : false,
screen : { width : 800, height : 600 },
locale : 'en',
logLevel : 'INFO'
}).on('connect', function () {
console.log('connected!!');
}).on('close', function() {
}).on('bitmap', function(bitmap) {
}).on('error', function(err) {
}).connect('106.162.16.143', 9602);
The current implementation seems doesn't support server pointer update.
When RDP server change the mouse pointer style by mouse hover effect, this RDP client will always use default mouse pointer. According to spec, RDP client should be able to reflect such update.
Please advise if it's possible to add such feature, many thanks!
bug: win7下方向键编程数字了
当输入 方向键
的时候,变成数字:
上 8
右 6
下 2
左 4
为什么?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.