forked from stevenh/HttpServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IHttpContext.cs
57 lines (50 loc) · 1.52 KB
/
IHttpContext.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
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.IO;
using System.Net;
using System.Net.Security;
using HttpServer.Logging;
using HttpServer.Messages;
namespace HttpServer
{
/// <summary>
/// Context that received a HTTP request.
/// </summary>
public interface IHttpContext
{
/// <summary>
/// Gets if current context is using a secure connection.
/// </summary>
bool IsSecure { get; }
/// <summary>
/// Gets logger.
/// </summary>
ILogger Logger { get; }
/// <summary>
/// Gets remote end point
/// </summary>
IPEndPoint RemoteEndPoint { get; }
/// <summary>
/// Gets stream used to send/receive data to/from remote end point.
/// </summary>
/// <remarks>
/// <para>
/// The stream can be any type of stream, do not assume that it's a network
/// stream. For instance, it can be a <see cref="SslStream"/> or a ZipStream.
/// </para>
/// </remarks>
Stream Stream { get; }
/// <summary>
/// Gets the currently handled request
/// </summary>
/// <value>The request.</value>
IRequest Request { get; }
/// <summary>
/// Gets the response that is going to be sent back
/// </summary>
/// <value>The response.</value>
IResponse Response { get; }
/// <summary>
/// Disconnect context.
/// </summary>
void Disconnect();
}
}