Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
WebServer.cs
2using System.Threading.Tasks;
5using Waher.Things;
8
10{
15 {
16 internal const string Id = "WebServer";
17
23 : base(Source, null)
24 {
25 }
26
30 [Page(7, "Configuration")]
31 [Header(14, "Client Certificates (mTLS):")]
32 [ToolTip(15, "How to allow clients authenticate themselves using X.509 certificates.")]
33 [Required]
34 [Option(ClientCertificates.NotUsed, 16, "Client certificates are not used, and will not be requested.")]
35 [Option(ClientCertificates.Optional, 17, "Client certificates are requested, but not required.")]
36 [Option(ClientCertificates.Required, 18, "Client certificates are requested, and required.")]
38
42 [Page(7, "Configuration")]
43 [Header(19, "Trust client certificates.")]
44 [ToolTip(20, "If client certificates should be trusted, even if they don't validate.")]
45 public bool TrustClientCertificates { get; set; }
46
50 [Page(118, "HTTP/2")]
51 [Header(119, "Enabled")]
52 [ToolTip(120, "If HTTP/2 is enabled or not.")]
53 public bool Http2Enabled { get; set; }
54
58 [Page(118, "HTTP/2")]
59 [Header(121, "Initial Stream Window Size:")]
60 [ToolTip(122, "Initial Stream Window Size, in bytes.")]
61 public int Http2InitialStreamWindowSize { get; set; }
62
66 [Page(118, "HTTP/2")]
67 [Header(137, "Initial Connection Window Size:")]
68 [ToolTip(138, "Initial Connection Window Size, in bytes.")]
69 public int Http2InitialConnectionWindowSize { get; set; }
70
74 [Page(118, "HTTP/2")]
75 [Header(123, "Maximum Frame Size:")]
76 [ToolTip(124, "Maximum Frame Size, in bytes.")]
77 public int Http2MaxFrameSize { get; set; }
78
82 [Page(118, "HTTP/2")]
83 [Header(125, "Maximum concurrent streams:")]
84 [ToolTip(126, "Maximum number of concurrent streams.")]
85 public int Http2MaxConcurrentStreams { get; set; }
86
90 [Page(118, "HTTP/2")]
91 [Header(127, "Dynamic Header Table Size:")]
92 [ToolTip(128, "Dynamic Header Table Size, in bytes.")]
93 public int Http2HeaderTableSize { get; set; }
94
98 [Page(118, "HTTP/2")]
99 [Header(129, "No RFC 7540 priorities.")]
100 [ToolTip(130, "If stream priorities, as defined in HTTP/2 RFC 7540, should not be used, in favour of priorities, as defined in RFC 9218 (used in HTTP/3).")]
101 public bool Http2NoRfc7540Priorities { get; set; }
102
106 [Page(118, "HTTP/2")]
107 [Header(131, "Connection profiling.")]
108 [ToolTip(132, "Enables profiling of HTTP/2 performance over connections.")]
109 public bool Http2Profiling { get; set; }
110
114 [Page(118, "HTTP/2")]
115 [Header(142, "Separate sniffers by remote endpoint.")]
116 [ToolTip(143, "Separates sniffers into different subfolders, depending on the remote endpoint.")]
117 public bool HttpSniffersPerEndpoint { get; set; }
118
122 public override string NodeId => Id;
123
128 public override Task<string> GetTypeNameAsync(Language Language) => Language.GetStringAsync(typeof(GatewayConfigSource), 64, "Web Server");
129
135 public override Task<bool> AcceptsChildAsync(INode Child)
136 {
137 return Task.FromResult(
138 Child is DefaultPage ||
139 Child is FileFolder ||
140 Child is VanityResource ||
141 Child is ContentEncoding ||
142 Child is Redirection ||
143 Child is ProxyResource ||
144 Child is ProxyDomain ||
145 Child is MTlsPort ||
147 }
148
155 public override async Task<IEnumerable<Parameter>> GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
156 {
157 LinkedList<Parameter> Parameters = new LinkedList<Parameter>();
159
160 Parameters.AddLast(new StringParameter("Protocol", await Namespace.GetStringAsync(108, "Certificates"), this.ClientCertificates.ToString()));
161 Parameters.AddLast(new BooleanParameter("Trust", await Namespace.GetStringAsync(109, "Trust"), this.TrustClientCertificates));
162
163 return Parameters;
164 }
165
171 public override Task<bool> CanDestroyAsync(RequestOrigin Caller)
172 {
173 return Task.FromResult(false);
174 }
175 }
176}
Contains information about a language.
Definition: Language.cs:17
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Definition: Language.cs:209
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Definition: Language.cs:99
Contains information about a namespace in a language.
Definition: Namespace.cs:17
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Definition: Namespace.cs:65
Abstract base class for gateway configuration nodes.
GatewayConfigSource Source
Source hosting the node.
Configures a Content-Encoding in the web server.
mTLS-configuration for a specific port number.
Definition: MTlsPort.cs:15
Defines a proxy domain to act as a reverse proxy for a specific domain name.
Definition: ProxyDomain.cs:19
Defines a proxy resource to act as a reverse proxy.
bool Http2Profiling
Maximum Frame Size, in bytes.
Definition: WebServer.cs:109
int Http2InitialConnectionWindowSize
Initial Connection Window Size, in bytes.
Definition: WebServer.cs:69
int Http2InitialStreamWindowSize
Initial Window Size, in bytes.
Definition: WebServer.cs:61
WebServer(GatewayConfigSource Source)
Settings for the Web Server.
Definition: WebServer.cs:22
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
Definition: WebServer.cs:135
int Http2HeaderTableSize
Dynamic Header Table Size, in bytes.
Definition: WebServer.cs:93
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
int Http2MaxConcurrentStreams
Maximum number of concurrent streams.
Definition: WebServer.cs:85
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
Definition: WebServer.cs:155
int Http2MaxFrameSize
Maximum Frame Size, in bytes.
Definition: WebServer.cs:77
override Task< bool > CanDestroyAsync(RequestOrigin Caller)
If the node can be destroyed to by the caller.
Definition: WebServer.cs:171
bool TrustClientCertificates
If certificates are to be trusted, or if they are required to be valid.
Definition: WebServer.cs:45
bool Http2Enabled
If HTTP/2 is enabled or not.
Definition: WebServer.cs:53
bool HttpSniffersPerEndpoint
Separate sniffers by remote endpoint.
Definition: WebServer.cs:117
bool Http2NoRfc7540Priorities
Maximum Frame Size, in bytes.
Definition: WebServer.cs:101
Tokens available in request.
Definition: RequestOrigin.cs:9
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49
ClientCertificates
Client Certificate Options