feat: working websocket debug server

This commit is contained in:
Neil Dorin
2023-11-20 19:21:30 -07:00
parent b263c7421b
commit 3eaa86905f
5 changed files with 10 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<Version>2.0.0-local</Version>
<InformationalVersion>$(Version)</InformationalVersion>
<Authors>PepperDash Technologies</Authors>
<Company>PepperDash Technologies</Company>
<Product>PepperDash Essentials</Product>

View File

@@ -26,7 +26,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2">
<Aliases>Full</Aliases>
</PackageReference>
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-351" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-366" />
</ItemGroup>
<ItemGroup>
<None Include="Crestron\CrestronGenericBaseDevice.cs.orig" />

View File

@@ -42,12 +42,7 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
var port = 0;
if(Debug.WebsocketSink == null)
{
Debug.Console(0, "WebsocketSink is null");
}
if (!Debug.WebsocketSink.IsListening)
if (!Debug.WebsocketSink.IsRunning)
{
Debug.Console(0, "Starting WS Server");
// Generate a random port within a specified range
@@ -56,11 +51,15 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
Debug.WebsocketSink.StartServerAndSetPort(port);
}
var url = Debug.WebsocketSink.Url;
object data = new
{
url = string.Format(@"wss://{0}:{1}", ip, Debug.WebsocketSink.Port)
url = Debug.WebsocketSink.Url
};
Debug.Console(0, "Debug Session URL: {0}", url);
// Return the port number with the full url of the WS Server
var res = JsonConvert.SerializeObject(data);

View File

@@ -31,6 +31,6 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2">
<Aliases>Full</Aliases>
</PackageReference>
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-351" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-366" />
</ItemGroup>
</Project>

View File

@@ -51,7 +51,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2">
<Aliases>Full</Aliases>
</PackageReference>
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-351" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-366" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />