mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 19:08:29 +00:00
feat: enhance WebSocket services with HTTP GET handler for certificate confirmation and increase timeout for port forwarding
This commit is contained in:
parent
a18f7800d1
commit
a732c5e08e
6 changed files with 53 additions and 5 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue