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> <Project>
<PropertyGroup> <PropertyGroup>
<Version>2.0.0-local</Version> <Version>2.0.0-local</Version>
<InformationalVersion>$(Version)</InformationalVersion>
<Authors>PepperDash Technologies</Authors> <Authors>PepperDash Technologies</Authors>
<Company>PepperDash Technologies</Company> <Company>PepperDash Technologies</Company>
<Product>PepperDash Essentials</Product> <Product>PepperDash Essentials</Product>

View File

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

View File

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

View File

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

View File

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