mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
feat: Enhance WebSocket URL generation to support dual-stack environments by using CSLAN IP if available
This commit is contained in:
parent
dc656bddf1
commit
2e1bb8b286
1 changed files with 6 additions and 1 deletions
|
|
@ -61,6 +61,11 @@ public class DebugWebsocketSink : ILogEventSink, IKeyed
|
||||||
if (_httpsServer == null || !_httpsServer.IsListening) return "";
|
if (_httpsServer == null || !_httpsServer.IsListening) return "";
|
||||||
var service = _httpsServer.WebSocketServices[_path];
|
var service = _httpsServer.WebSocketServices[_path];
|
||||||
if (service == null) return "";
|
if (service == null) return "";
|
||||||
|
|
||||||
|
// Use CSLAN IP if available, otherwise fallback to primary IP. This ensures we provide a reachable URL in dual-stack environments.
|
||||||
|
if (!string.IsNullOrEmpty(CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1)))
|
||||||
|
return $"wss://{CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1)}:{_httpsServer.Port}{service.Path}";
|
||||||
|
else
|
||||||
return $"wss://{CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0)}:{_httpsServer.Port}{service.Path}";
|
return $"wss://{CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0)}:{_httpsServer.Port}{service.Path}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue