Skip to content

Instantly share code, notes, and snippets.

@Greyeye
Created February 17, 2014 10:06
Show Gist options
  • Save Greyeye/9047950 to your computer and use it in GitHub Desktop.
Save Greyeye/9047950 to your computer and use it in GitHub Desktop.
to make it download RDP file from node.js
<!-- AngularJS Sample code -->
<a class="btn btn-default" href="" ng-href="http://localhost:8080/rdp/{{PrivateIpAddress}}">{{PrivateIpAddress}}</a></div>
var express = require('express');
var app = express();
app.get("/rdp/:address", function(req, res){
res.setHeader('Content-Type', 'application/x-rdp');
res.setHeader('Content-Disposition', 'attachment; filename=' + req.params.address + '.rdp');
res.end("full address:s:" + req.params.address + ":3389\r\nprompt for credentials:i:1");
});
app.listen(8080, function(){
console.log('Booting up Express @ http://localhost:8080');
});
===sample 1===
screen mode id:i:2
desktopwidth:i:1280
desktopheight:i:768
session bpp:i:32
winposstr:s:2,3,1430,104,2230,704
compression:i:1
keyboardhook:i:2
displayconnectionbar:i:1
disable wallpaper:i:1
disable full window drag:i:1
allow desktop composition:i:0
allow font smoothing:i:0
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s: [YOUR IP]
audiomode:i:0
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards:i:1
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:1
drivestoredirect:s:
===sample 2===
gatewayhostname:s:[ts gateway host]
screen mode id:i:0
use multimon:i:0
session bpp:i:16
full address:s:[IP or HOSTNAME]
audiomode:i:2
username:s:<DOMAIN\USERNAME>
disable wallpaper:i:0
disable full window drag:i:0
disable menu anims:i:0
disable themes:i:0
alternate shell:s:
shell working directory:s:
authentication level:i:2
connect to console:i:0
gatewayusagemethod:i:[0 or 1]
disable cursor setting:i:0
allow font smoothing:i:1
allow desktop composition:i:1
bookmarktype:i:3
use redirection server name:i:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment