-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathHostMapping.cs
77 lines (54 loc) · 1.78 KB
/
HostMapping.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
namespace HttpReverseProxy.Plugin.HostMapping
{
using HttpReverseProxyLib.DataTypes.Enum;
using HttpReverseProxyLib.DataTypes.Interface;
using System.IO;
using HostMappingConfig = HttpReverseProxy.Plugin.HostMapping.Config;
public partial class HostMapping : IPlugin
{
#region MEMBERS
private PluginProperties pluginProperties = new PluginProperties();
private Config pluginConfig = new Config();
private string configurationFileFullPath;
#endregion
#region PROPERTIES
public PluginProperties PluginProperties { get { return this.pluginProperties; } set { } }
#endregion
#region PUBLIC
public HostMapping()
{
// Set plugin properties
this.pluginProperties.Name = HostMappingConfig.PluginName;
this.pluginProperties.Priority = HostMappingConfig.PluginPriority;
this.pluginProperties.Version = HostMappingConfig.PluginVersion;
this.pluginProperties.PluginDirectory = Path.Combine(Directory.GetCurrentDirectory(), "plugins", HostMappingConfig.PluginName);
this.pluginProperties.IsActive = true;
this.pluginProperties.SupportedProtocols = ProxyProtocol.Http | ProxyProtocol.Https;
}
#endregion
#region INTERFACE IMPLEMENTATION: Properties
public PluginProperties Config { get { return this.pluginProperties; } set { this.pluginProperties = value; } }
#endregion
#region INTERFACE IMPLEMENTATION: IComparable
public int CompareTo(IPlugin other)
{
if (other == null)
{
return 1;
}
if (this.Config.Priority > other.Config.Priority)
{
return 1;
}
else if (this.Config.Priority < other.Config.Priority)
{
return -1;
}
else
{
return 0;
}
}
#endregion
}
}