From f9a0a5344fc95f01a30fd07ce784fd3ed094ffa9 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Tue, 28 Apr 2020 21:05:59 -0700 Subject: [PATCH] Add configurable IceServers and concurrent update count. --- ScreenCast.Core/Communication/CasterSocket.cs | 10 ++++-- .../Communication/WebRtcSession.cs | 21 +++++++---- ScreenCast.Core/Models/Viewer.cs | 10 +++--- ScreenCast.Core/Services/ScreenCaster.cs | 3 +- Server/API/AgentUpdateController.cs | 13 +++++-- Server/Server.csproj | 2 ++ Server/Services/ApplicationConfig.cs | 36 ++++++++++++------- Server/Services/RCDeviceHub.cs | 9 +++-- Server/appsettings.json | 9 +++-- .../wwwroot/scripts/Models/IceServerModel.js | 3 ++ .../scripts/Models/IceServerModel.js.map | 1 + .../wwwroot/scripts/Models/IceServerModel.ts | 5 +++ .../scripts/RemoteControl/RCHubConnection.js | 4 +-- .../RemoteControl/RCHubConnection.js.map | 2 +- .../scripts/RemoteControl/RCHubConnection.ts | 5 +-- .../scripts/RemoteControl/RtcSession.js | 14 +++++--- .../scripts/RemoteControl/RtcSession.js.map | 2 +- .../scripts/RemoteControl/RtcSession.ts | 16 ++++++--- Shared/Models/IceServerModel.cs | 13 +++++++ 19 files changed, 126 insertions(+), 52 deletions(-) create mode 100644 Server/wwwroot/scripts/Models/IceServerModel.js create mode 100644 Server/wwwroot/scripts/Models/IceServerModel.js.map create mode 100644 Server/wwwroot/scripts/Models/IceServerModel.ts create mode 100644 Shared/Models/IceServerModel.cs diff --git a/ScreenCast.Core/Communication/CasterSocket.cs b/ScreenCast.Core/Communication/CasterSocket.cs index 3bb31e1a2..9c3c56cea 100644 --- a/ScreenCast.Core/Communication/CasterSocket.cs +++ b/ScreenCast.Core/Communication/CasterSocket.cs @@ -67,11 +67,15 @@ public async Task Disconnect() await Connection.DisposeAsync(); } + public async Task GetIceServers() + { + return await Connection.InvokeAsync("GetIceServers"); + } + public async Task GetSessionID() { await Connection.SendAsync("GetSessionID"); } - public async Task NotifyRequesterUnattendedReady(string requesterID) { await Connection.SendAsync("NotifyRequesterUnattendedReady", requesterID); @@ -127,9 +131,9 @@ public async Task SendMachineName(string machineName, string viewerID) await Connection.SendAsync("SendMachineName", machineName, viewerID); } - public async Task SendRtcOfferToBrowser(string sdp, string viewerID) + public async Task SendRtcOfferToBrowser(string sdp, string viewerID, IceServerModel[] iceServers) { - await Connection.SendAsync("SendRtcOfferToBrowser", sdp, viewerID); + await Connection.SendAsync("SendRtcOfferToBrowser", sdp, viewerID, iceServers); } public async Task SendScreenCapture(byte[] captureBytes, string viewerID, int left, int top, int width, int height, int imageQuality) diff --git a/ScreenCast.Core/Communication/WebRtcSession.cs b/ScreenCast.Core/Communication/WebRtcSession.cs index 67077f058..f1f9acada 100644 --- a/ScreenCast.Core/Communication/WebRtcSession.cs +++ b/ScreenCast.Core/Communication/WebRtcSession.cs @@ -26,6 +26,7 @@ public WebRtcSession(IRtcMessageHandler rtcMessageHandler) public bool IsPeerConnected => PeerConnection?.IsConnected == true; private DataChannel CaptureChannel { get; set; } private PeerConnection PeerConnection { get; set; } + private IceServerModel[] IceServers { get; set; } private IRtcMessageHandler RtcMessageHandler { get; } public void AddIceCandidate(string sdpMid, int sdpMlineIndex, string candidate) { @@ -38,18 +39,24 @@ public void Dispose() PeerConnection?.Dispose(); } - public async Task Init() + public async Task Init(IceServerModel[] iceServers) { Logger.Debug("Starting WebRTC connection."); + + IceServers = iceServers; + PeerConnection = new PeerConnection(); + var iceList = IceServers.Select(x => new IceServer() + { + Urls = { x.Url }, + TurnPassword = x.TurnPassword ?? string.Empty, + TurnUserName = x.TurnUsername ?? string.Empty + }).ToList(); + var config = new PeerConnectionConfiguration() { - IceServers = new List - { - new IceServer{ Urls = { "stun:stun.l.google.com:19302" } }, - new IceServer{ Urls = { "stun:stun4.l.google.com:19302" } } - } + IceServers = iceList }; await PeerConnection.InitializeAsync(config); @@ -139,7 +146,7 @@ private async void CaptureChannel_StateChanged() Logger.Debug($"DataChannel state changed. New State: {CaptureChannel.State}"); if (CaptureChannel.State == DataChannel.ChannelState.Closed) { - await Init(); + await Init(IceServers); } } private void DataChannel_BufferingChanged(ulong previous, ulong current, ulong limit) diff --git a/ScreenCast.Core/Models/Viewer.cs b/ScreenCast.Core/Models/Viewer.cs index 9735c6fa7..4b88ac4e7 100644 --- a/ScreenCast.Core/Models/Viewer.cs +++ b/ScreenCast.Core/Models/Viewer.cs @@ -34,11 +34,8 @@ public Viewer(CasterSocket casterSocket, public IScreenCapturer Capturer { get; } public bool DisconnectRequested { get; set; } - public EncoderParameters EncoderParams { get; private set; } - public bool HasControl { get; set; } = true; - public int ImageQuality { get @@ -81,16 +78,19 @@ public async Task InitializeWebRtc() { try { + var iceServers = await CasterSocket.GetIceServers(); + RtcSession = WebRtcSessionFactory.GetNewSession(this); RtcSession.LocalSdpReady += async (sender, sdp) => { - await CasterSocket.SendRtcOfferToBrowser(sdp, ViewerConnectionID); + await CasterSocket.SendRtcOfferToBrowser(sdp, ViewerConnectionID, iceServers); }; RtcSession.IceCandidateReady += async (sender, args) => { await CasterSocket.SendIceCandidateToBrowser(args.candidate, args.sdpMlineIndex, args.sdpMid, ViewerConnectionID); }; - await RtcSession.Init(); + + await RtcSession.Init(iceServers); } catch (Exception ex) { diff --git a/ScreenCast.Core/Services/ScreenCaster.cs b/ScreenCast.Core/Services/ScreenCaster.cs index 054e28c78..4d23e2c0b 100644 --- a/ScreenCast.Core/Services/ScreenCaster.cs +++ b/ScreenCast.Core/Services/ScreenCaster.cs @@ -19,7 +19,8 @@ namespace Remotely.ScreenCast.Core.Services { public class ScreenCaster : IScreenCaster { - public ScreenCaster(Conductor conductor, ICursorIconWatcher cursorIconWatcher) + public ScreenCaster(Conductor conductor, + ICursorIconWatcher cursorIconWatcher) { Conductor = conductor; CursorIconWatcher = cursorIconWatcher; diff --git a/Server/API/AgentUpdateController.cs b/Server/API/AgentUpdateController.cs index ece357ef2..b9f6033dd 100644 --- a/Server/API/AgentUpdateController.cs +++ b/Server/API/AgentUpdateController.cs @@ -16,13 +16,17 @@ public class AgentUpdateController : ControllerBase private static readonly MemoryCache downloadingAgents = new MemoryCache(new MemoryCacheOptions()); - public AgentUpdateController(IWebHostEnvironment hostingEnv, DataService dataService) + public AgentUpdateController(IWebHostEnvironment hostingEnv, + DataService dataService, + ApplicationConfig appConfig) { - this.HostEnv = hostingEnv; + HostEnv = hostingEnv; DataService = dataService; + AppConfig = appConfig; } private DataService DataService { get; } + public ApplicationConfig AppConfig { get; } private IWebHostEnvironment HostEnv { get; } @@ -50,10 +54,13 @@ public async Task DownloadPackage(string platform, string download { try { - while (downloadingAgents.Count > 10) + var startWait = DateTimeOffset.Now; + while (downloadingAgents.Count > AppConfig.MaxConcurrentUpdates) { await Task.Delay(new Random().Next(100, 10000)); } + var waitTime = DateTimeOffset.Now - startWait; + DataService.WriteEvent($"Download started after wait time of {waitTime}.", Shared.Models.EventType.Debug, string.Empty); downloadingAgents.Set(downloadId, string.Empty, TimeSpan.FromMinutes(10)); diff --git a/Server/Server.csproj b/Server/Server.csproj index 72b79b008..a9bad88e4 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -47,6 +47,7 @@ + @@ -157,6 +158,7 @@ + diff --git a/Server/Services/ApplicationConfig.cs b/Server/Services/ApplicationConfig.cs index 65908896f..270dc8748 100644 --- a/Server/Services/ApplicationConfig.cs +++ b/Server/Services/ApplicationConfig.cs @@ -1,36 +1,46 @@ using Microsoft.Extensions.Configuration; +using Remotely.Shared.Models; namespace Remotely.Server.Services { public class ApplicationConfig { + private IceServerModel[] fallbackIceServers = new IceServerModel[] + { + new IceServerModel() { Url = "stun: stun.l.google.com:19302"}, + new IceServerModel() { Url = "stun: stun4.l.google.com:19302"} + }; + public ApplicationConfig(IConfiguration config) { Config = config; } - public bool AllowApiLogin => bool.Parse(Config["ApplicationOptions:AllowApiLogin"]); - public double DataRetentionInDays => double.Parse(Config["ApplicationOptions:DataRetentionInDays"]); - public string DBProvider => Config["ApplicationOptions:DBProvider"]; - public string DefaultPrompt => Config["ApplicationOptions:DefaultPrompt"]; + + public bool AllowApiLogin => bool.Parse(Config["ApplicationOptions:AllowApiLogin"] ?? "false"); + public double DataRetentionInDays => double.Parse(Config["ApplicationOptions:DataRetentionInDays"] ?? "30"); + public string DBProvider => Config["ApplicationOptions:DBProvider"] ?? "SQLite"; + public string DefaultPrompt => Config["ApplicationOptions:DefaultPrompt"] ?? "~>"; public bool EnableWindowsEventLog => bool.Parse(Config["ApplicationOptions:EnableWindowsEventLog"]); + public IceServerModel[] IceServers => Config.GetSection("ApplicationOptions:IceServers").Get() ?? fallbackIceServers; public string[] KnownProxies => Config.GetSection("ApplicationOptions:KnownProxies").Get(); - public int MaxOrganizationCount => int.Parse(Config["ApplicationOptions:MaxOrganizationCount"]); - public bool RecordRemoteControlSessions => bool.Parse(Config["ApplicationOptions:RecordRemoteControlSessions"]); - public bool RedirectToHttps => bool.Parse(Config["ApplicationOptions:RedirectToHttps"]); - public bool RemoteControlRequiresAuthentication => bool.Parse(Config["ApplicationOptions:RemoteControlRequiresAuthentication"]); - public double RemoteControlSessionLimit => double.Parse(Config["ApplicationOptions:RemoteControlSessionLimit"]); - public bool Require2FA => bool.Parse(Config["ApplicationOptions:Require2FA"]); + public int MaxConcurrentUpdates => int.Parse(Config["ApplicationOptions:MaxConcurrentUpdates"] ?? "10"); + public int MaxOrganizationCount => int.Parse(Config["ApplicationOptions:MaxOrganizationCount"] ?? "1"); + public bool RecordRemoteControlSessions => bool.Parse(Config["ApplicationOptions:RecordRemoteControlSessions"] ?? "false"); + public bool RedirectToHttps => bool.Parse(Config["ApplicationOptions:RedirectToHttps"] ?? "false"); + public bool RemoteControlRequiresAuthentication => bool.Parse(Config["ApplicationOptions:RemoteControlRequiresAuthentication"] ?? "true"); + public double RemoteControlSessionLimit => double.Parse(Config["ApplicationOptions:RemoteControlSessionLimit"] ?? "3"); + public bool Require2FA => bool.Parse(Config["ApplicationOptions:Require2FA"] ?? "false"); public string SmtpDisplayName => Config["ApplicationOptions:SmtpDisplayName"]; public string SmtpEmail => Config["ApplicationOptions:SmtpEmail"]; - public bool SmtpEnableSsl => bool.Parse(Config["ApplicationOptions:SmtpEnableSsl"]); + public bool SmtpEnableSsl => bool.Parse(Config["ApplicationOptions:SmtpEnableSsl"] ?? "true"); public string SmtpHost => Config["ApplicationOptions:SmtpHost"]; public string SmtpPassword => Config["ApplicationOptions:SmtpPassword"]; public int SmtpPort => int.Parse(Config["ApplicationOptions:SmtpPort"]); public string SmtpUserName => Config["ApplicationOptions:SmtpUserName"]; public string Theme => Config["ApplicationOptions:Theme"]; public string[] TrustedCorsOrigins => Config.GetSection("ApplicationOptions:TrustedCorsOrigins").Get(); - public bool UseHsts => bool.Parse(Config["ApplicationOptions:UseHsts"]); - public bool UseWebRtc => bool.Parse(Config["ApplicationOptions:UseWebRtc"]); + public bool UseHsts => bool.Parse(Config["ApplicationOptions:UseHsts"] ?? "false"); + public bool UseWebRtc => bool.Parse(Config["ApplicationOptions:UseWebRtc"] ?? "true"); private IConfiguration Config { get; set; } } } diff --git a/Server/Services/RCDeviceHub.cs b/Server/Services/RCDeviceHub.cs index 5c5e956bf..eb3ba9b0b 100644 --- a/Server/Services/RCDeviceHub.cs +++ b/Server/Services/RCDeviceHub.cs @@ -84,6 +84,11 @@ public Task CtrlAltDel() { return DeviceHubContext.Clients.Client(SessionInfo.ServiceID).SendAsync("CtrlAltDel"); } + public IceServerModel[] GetIceServers() + { + return AppConfig.IceServers; + } + public Task GetSessionID() { var random = new Random(); @@ -186,11 +191,11 @@ public Task SendMachineName(string machineName, string viewerID) return RCBrowserHubContext.Clients.Client(viewerID).SendAsync("ReceiveMachineName", machineName); } - public Task SendRtcOfferToBrowser(string sdp, string viewerID) + public Task SendRtcOfferToBrowser(string sdp, string viewerID, IceServerModel[] iceServers) { if (AppConfig.UseWebRtc) { - return RCBrowserHubContext.Clients.Client(viewerID).SendAsync("ReceiveRtcOffer", sdp); + return RCBrowserHubContext.Clients.Client(viewerID).SendAsync("ReceiveRtcOffer", sdp, iceServers); } return Task.CompletedTask; diff --git a/Server/appsettings.json b/Server/appsettings.json index 52d39c0bd..2892ecb5b 100644 --- a/Server/appsettings.json +++ b/Server/appsettings.json @@ -11,15 +11,20 @@ }, "ApplicationOptions": { "AllowApiLogin": false, - "MaxOrganizationCount": 1, "DataRetentionInDays": 90, "DBProvider": "SQLite", "DefaultPrompt": "~>", "EnableWindowsEventLog": false, + "IceServers": [ + { "Url": "stun: stun.l.google.com:19302" }, + { "Url": "stun: stun4.l.google.com:19302" } + ], "KnownProxies": [], + "MaxConcurrentUpdates": 10, + "MaxOrganizationCount": 1, "RecordRemoteControlSessions": false, "RedirectToHttps": false, - "RemoteControlSessionLimit": 1, + "RemoteControlSessionLimit": 3, "RemoteControlRequiresAuthentication": true, "Require2FA": false, "SmtpHost": "", diff --git a/Server/wwwroot/scripts/Models/IceServerModel.js b/Server/wwwroot/scripts/Models/IceServerModel.js new file mode 100644 index 000000000..f1aff2cfd --- /dev/null +++ b/Server/wwwroot/scripts/Models/IceServerModel.js @@ -0,0 +1,3 @@ +export class IceServerModel { +} +//# sourceMappingURL=IceServerModel.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/IceServerModel.js.map b/Server/wwwroot/scripts/Models/IceServerModel.js.map new file mode 100644 index 000000000..a876828bf --- /dev/null +++ b/Server/wwwroot/scripts/Models/IceServerModel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IceServerModel.js","sourceRoot":"","sources":["IceServerModel.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;CAI1B"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Models/IceServerModel.ts b/Server/wwwroot/scripts/Models/IceServerModel.ts new file mode 100644 index 000000000..fbdd551c3 --- /dev/null +++ b/Server/wwwroot/scripts/Models/IceServerModel.ts @@ -0,0 +1,5 @@ +export class IceServerModel { + Url: string; + TurnPassword: string; + TurnUsername: string; +} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js index ced32d995..35528a1b0 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js +++ b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js @@ -191,9 +191,9 @@ export class RCHubConnection { hubConnection.on("RequestingScreenCast", () => { UI.ShowMessage("Requesting remote control..."); }); - hubConnection.on("ReceiveRtcOffer", async (sdp) => { + hubConnection.on("ReceiveRtcOffer", async (sdp, iceServers) => { console.log("Rtc offer SDP received."); - MainRc.RtcSession.Init(); + MainRc.RtcSession.Init(iceServers); await MainRc.RtcSession.ReceiveRtcOffer(sdp); }); hubConnection.on("ReceiveIceCandidate", (candidate, sdpMlineIndex, sdpMid) => { diff --git a/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js.map b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js.map index b212fb1bf..1e288aacf 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js.map +++ b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.js.map @@ -1 +1 @@ -{"version":3,"file":"RCHubConnection.js","sourceRoot":"","sources":["RCHubConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAUhC,MAAM,OAAO,eAAe;IAExB,OAAO;QACH,IAAI,CAAC,UAAU,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE;aAC/C,OAAO,CAAC,eAAe,CAAC;aACxB,eAAe,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;aACvE,gBAAgB,CAAC,OAAO,CAAC,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ot/scripts/RemoteControl/RCHubConnection.ts b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.ts index 902ddaf1e..0f7f1d55a 100644 --- a/Server/wwwroot/scripts/RemoteControl/RCHubConnection.ts +++ b/Server/wwwroot/scripts/RemoteControl/RCHubConnection.ts @@ -3,6 +3,7 @@ import { MainRc } from "./Main.js"; import { CursorInfo } from "../Models/CursorInfo.js"; import { Sound } from "../Sound.js"; import { ShowMessage } from "../UI.js"; +import { IceServerModel } from "../Models/IceServerModel.js"; var signalR = window["signalR"]; @@ -215,9 +216,9 @@ export class RCHubConnection { }); - hubConnection.on("ReceiveRtcOffer", async (sdp: string) => { + hubConnection.on("ReceiveRtcOffer", async (sdp: string, iceServers: IceServerModel[]) => { console.log("Rtc offer SDP received."); - MainRc.RtcSession.Init(); + MainRc.RtcSession.Init(iceServers); await MainRc.RtcSession.ReceiveRtcOffer(sdp); }); diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.js b/Server/wwwroot/scripts/RemoteControl/RtcSession.js index d1e2a1248..acf0943f0 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.js +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.js @@ -5,12 +5,16 @@ export class RtcSession { constructor() { this.MessagePack = window['MessagePack']; } - Init() { + Init(iceServers) { this.PeerConnection = new RTCPeerConnection({ - iceServers: [ - { urls: "stun: stun.l.google.com:19302" }, - { urls: "stun:stun4.l.google.com:19302" } - ] + iceServers: iceServers.map(x => { + return { + urls: x.Url, + username: x.TurnUsername, + credential: x.TurnPassword, + credentialType: "password" + }; + }) }); this.PeerConnection.ondatachannel = (ev) => { console.log("Data channel received."); diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map b/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map index ec061b8e5..cc5fdde4b 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.js.map @@ -1 +1 @@ -{"version":3,"file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iB,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC;YACxF,MAAM,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACrF,CAAC,CAAC,CAAA;IACN,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,SAA0B;QAC7C,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;YAChB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YACf,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACtC,CAAC,CAAC,CAAA;IACN,CAAC;IAED,OAAO,CAAC,GAAQ;QACZ,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/RemoteControl/RtcSession.ts b/Server/wwwroot/scripts/RemoteControl/RtcSession.ts index 8b1c4b1d8..dab11ab1f 100644 --- a/Server/wwwroot/scripts/RemoteControl/RtcSession.ts +++ b/Server/wwwroot/scripts/RemoteControl/RtcSession.ts @@ -1,17 +1,23 @@ import * as UI from "./UI.js"; import * as Utilities from "../Utilities.js"; import { MainRc } from "./Main.js"; +import { IceServerModel } from "../Models/IceServerModel.js"; export class RtcSession { PeerConnection: RTCPeerConnection; DataChannel: RTCDataChannel; MessagePack: any = window['MessagePack']; - Init() { + Init(iceServers: IceServerModel[]) { + this.PeerConnection = new RTCPeerConnection({ - iceServers: [ - { urls: "stun: stun.l.google.com:19302" }, - { urls: "stun:stun4.l.google.com:19302" } - ] + iceServers: iceServers.map(x => { + return { + urls: x.Url, + username: x.TurnUsername, + credential: x.TurnPassword, + credentialType: "password" + } + }) }); this.PeerConnection.ondatachannel = (ev) => { diff --git a/Shared/Models/IceServerModel.cs b/Shared/Models/IceServerModel.cs new file mode 100644 index 000000000..6c4e9febd --- /dev/null +++ b/Shared/Models/IceServerModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Remotely.Shared.Models +{ + public class IceServerModel + { + public string Url { get; set; } + public string TurnPassword { get; set; } + public string TurnUsername { get; set; } + } +}