-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSslProxyServerHandler.cs
44 lines (38 loc) · 1.32 KB
/
SslProxyServerHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// The Sisk Framework source code
// Copyright (c) 2024- PROJECT PRINCIPIUM and all Sisk contributors
//
// The code below is licensed under the MIT license as
// of the date of its publication, available at
//
// File name: SslProxyServerHandler.cs
// Repository: https://github.com/sisk-http/core
using Sisk.Core.Http;
using Sisk.Core.Http.Handlers;
namespace Sisk.Ssl;
/// <summary>
/// Provides event handlers and hooks for <see cref="SslProxy"/>.
/// </summary>
public sealed class SslProxyServerHandler : HttpServerHandler {
/// <summary>
/// Gets the <see cref="SslProxy"/> instance used in this server handler.
/// </summary>
public SslProxy SecureProxy { get; }
/// <summary>
/// Creates an new <see cref="SslProxyServerHandler"/> instance with the
/// specified <see cref="SslProxy"/> instance.
/// </summary>
/// <param name="secureProxy">The <see cref="SslProxy"/> instance.</param>
public SslProxyServerHandler ( SslProxy secureProxy ) {
this.SecureProxy = secureProxy;
}
/// <exclude/>
/// <inheritdoc/>
protected override void OnServerStarted ( HttpServer server ) {
this.SecureProxy.Start ();
}
/// <exclude/>
/// <inheritdoc/>
protected override void OnServerStopping ( HttpServer server ) {
this.SecureProxy.Dispose ();
}
}