feat: enhance WebSocket services with HTTP GET handler for certificate confirmation and increase timeout for port forwarding

This commit is contained in:
Neil Dorin 2026-06-23 16:08:42 -06:00
parent a18f7800d1
commit a732c5e08e
6 changed files with 53 additions and 5 deletions

View file

@ -262,6 +262,7 @@ public class DebugWebsocketSink : ILogEventSink, IKeyed
}
Debug.LogInformation("Adding Debug Client Service");
_httpsServer.AddWebSocketService<DebugClient>(_path);
_httpsServer.OnGet += HandleHttpGet;
Debug.LogInformation("Assigning Log Info");
_httpsServer.Log.Level = LogLevel.Trace;
_httpsServer.Log.Output = WriteWebSocketInternalLog;
@ -279,6 +280,16 @@ public class DebugWebsocketSink : ILogEventSink, IKeyed
}
}
private void HandleHttpGet(object sender, HttpRequestEventArgs e)
{
var res = e.Response;
var body = System.Text.Encoding.UTF8.GetBytes(
"<html><body><h2>Certificate accepted.</h2><p>You can close this tab and return to the application.</p></body></html>");
res.ContentType = "text/html";
res.ContentLength64 = body.Length;
res.Close(body, true);
}
/// <summary>
/// Stops the WebSocket server if it is currently running.
/// </summary>