Skip to content

Commit

Permalink
Fixes #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Sep 29, 2019
1 parent 0d72b96 commit ea0224f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/UniversalDashboard/Cmdlets/StartDashboardCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Security;
using System.IO;
using System.Reflection;
using System.Net;

namespace UniversalDashboard.Cmdlets
{
Expand Down Expand Up @@ -57,7 +58,9 @@ public class StartDashboardCommand : PSCmdlet

[Parameter()]
public SwitchParameter Force { get; set; }

[Parameter()]
public IPAddress ListenAddress { get; set; } = IPAddress.Any;

protected override void EndProcessing()
{
var assemblyBasePath = Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location);
Expand Down Expand Up @@ -148,6 +151,7 @@ protected override void EndProcessing()
options.EndpointInitialSessionState = Dashboard.EndpointInitialSessionState;
options.UpdateToken = UpdateToken;
options.PublishedFolders = PublishedFolder;
options.ListenAddress = ListenAddress;

try
{
Expand Down
5 changes: 5 additions & 0 deletions src/UniversalDashboard/Cmdlets/StartRestApiCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Management.Automation.Runspaces;
using System.Linq;
using UniversalDashboard.Services;
using System.Net;

namespace UniversalDashboard.Cmdlets
{
Expand Down Expand Up @@ -47,6 +48,9 @@ public class StartRestApiCommand : PSCmdlet
[Parameter()]
public SwitchParameter Force { get; set; }

[Parameter()]
public IPAddress ListenAddress { get; set; } = IPAddress.Any;


protected override void EndProcessing()
{
Expand Down Expand Up @@ -81,6 +85,7 @@ protected override void EndProcessing()
options.Password = CertificateFilePassword;
options.EndpointInitialSessionState = EndpointInitialization;
options.PublishedFolders = PublishedFolder;
options.ListenAddress = ListenAddress;

try
{
Expand Down
2 changes: 2 additions & 0 deletions src/UniversalDashboard/Models/DashboardOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Security.Cryptography.X509Certificates;
using System.Security;
using System.Management.Automation.Runspaces;
using System.Net;

namespace UniversalDashboard
{
Expand All @@ -19,5 +20,6 @@ public class DashboardOptions {
public string UpdateToken { get; set; }
public Dictionary<Guid, string> ElementScripts { get; set; }
public PublishedFolder[] PublishedFolders { get; set; }
public IPAddress ListenAddress { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/UniversalDashboard/Server/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void Start(DashboardOptions dashboardOptions)
});
builder = builder.UseKestrel(options =>
{
options.Listen(IPAddress.Any, dashboardOptions.Port, listenOptions =>
options.Listen(dashboardOptions.ListenAddress, dashboardOptions.Port, listenOptions =>
{
if (dashboardOptions.Certificate != null)
{
Expand Down

0 comments on commit ea0224f

Please sign in to comment.