Skip to content

Better support for remote desktop connection broker #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Myrtille.Services.Contracts/IRemoteSessionProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ void StartProcess(
int clientHeight,
bool allowRemoteClipboard,
bool allowPrintDownload,
bool allowAudioPlayback);
bool allowAudioPlayback,
string loadBalanceInfo);

/// <summary>
/// stop the host client process
Expand Down
1 change: 1 addition & 0 deletions Myrtille.Services.Contracts/Models/ConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ public class ConnectionInfo
/// </summary>
public string StartProgram { get; set; }
public string GatewayUrl { get; set; }
public string LoadBalanceInfo { get; set; }
}
}
6 changes: 4 additions & 2 deletions Myrtille.Services/RemoteSessionProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public void StartProcess(
int clientHeight,
bool allowRemoteClipboard,
bool allowPrintDownload,
bool allowAudioPlayback)
bool allowAudioPlayback,
string loadBalanceInfo)
{
Trace.TraceInformation("Connecting remote session {0}, type {1}, security {2}, server (:port) {3}, vm {4}, domain {5}, user {6}, program {7}",
remoteSessionId,
Expand Down Expand Up @@ -353,7 +354,8 @@ public void StartProcess(
(allowRemoteClipboard ? " +" : " -") + "clipboard" + // clipboard support
(securityProtocol != SecurityProtocol.auto ? " /sec:" + securityProtocol.ToString() : string.Empty) + // security protocol
(allowAudioPlayback ? " /sound" : string.Empty) + // sound support
" /audio-mode:" + (allowAudioPlayback ? "0" : "2"); // audio mode (0: redirect, 1: play on server, 2: do not play)
" /audio-mode:" + (allowAudioPlayback ? "0" : "2") + // audio mode (0: redirect, 1: play on server, 2: do not play)
(!string.IsNullOrEmpty(loadBalanceInfo) ? " /load-balance-info:\"" + loadBalanceInfo +"\"" : string.Empty); // load balance info from RDS-file
}

#endregion
Expand Down
5 changes: 5 additions & 0 deletions Myrtille.Web/Default.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@
<label id="programLabel" for="program">Program to run (optional)</label>
<input type="text" runat="server" id="program" title="executable path, name and parameters (double quotes must be escaped) (optional)"/>
</div>

<div class="inputDiv" runat="server" Visible="False">
<label id="loadBalanceInfoLabel" for="loadBalanceInfo">Load Balancer Info</label>
<input type="text" runat="server" id="loadBalanceInfo"/>
</div>

<!-- connect -->
<input type="submit" runat="server" id="connect" value="Connect!" onserverclick="ConnectButtonClick" title="open session"/>
Expand Down
8 changes: 6 additions & 2 deletions Myrtille.Web/Default.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Myrtille.Web
{
public partial class Default : Page
{
private MFAAuthenticationClient _mfaAuthClient = new MFAAuthenticationClient();
private MFAAuthenticationClient _mfaAuthClient = new MFAAuthenticationClient();
private EnterpriseClient _enterpriseClient = new EnterpriseClient();
private ConnectionClient _connectionClient = new ConnectionClient(Settings.Default.ConnectionServiceUrl);

Expand Down Expand Up @@ -527,6 +527,7 @@ private bool ConnectRemoteServer()
var loginUser = user.Value;
var loginPassword = string.IsNullOrEmpty(passwordHash.Value) ? password.Value : CryptoHelper.RDP_Decrypt(passwordHash.Value);
var startProgram = program.Value;
var loadBalanceInfoValue = loadBalanceInfo?.Value;

// allowed features
var allowRemoteClipboard = _allowRemoteClipboard;
Expand Down Expand Up @@ -620,6 +621,8 @@ private bool ConnectRemoteServer()
allowAudioPlayback = allowAudioPlayback && connection.AllowAudioPlayback;

maxActiveGuests = connection.MaxActiveGuests;

loadBalanceInfoValue = connection.LoadBalanceInfo;
}
catch (Exception exc)
{
Expand Down Expand Up @@ -670,7 +673,8 @@ private bool ConnectRemoteServer()
maxActiveGuests,
Session.SessionID,
(string)Session[HttpSessionStateVariables.ClientKey.ToString()],
Request["cid"] != null
Request["cid"] != null,
loadBalanceInfoValue
);

// bind the remote session to the current http session
Expand Down
Loading