4using System.Threading.Tasks;
28 this.LocalResource =
string.Empty;
29 this.RemoteDomain =
string.Empty;
30 this.RemoteFolder =
string.Empty;
32 this.Encrypted =
false;
33 this.UseSession =
false;
34 this.TimeoutMs = 30000;
35 this.Privilege =
string.Empty;
69 [Page(7,
"Configuration")]
70 [Header(85,
"Local Resource:")]
71 [ToolTip(86,
"Local Resource that will act as a reverse proxy.")]
78 [Page(7,
"Configuration")]
79 [Header(87,
"Remote Domain:")]
80 [ToolTip(88,
"Domain of web server to forward requests to.")]
87 [Page(7,
"Configuration")]
88 [Header(89,
"Remote Folder:")]
89 [ToolTip(90,
"Base folder on remote domain that requests will be forwarded to.")]
95 [Page(7,
"Configuration")]
96 [Header(91,
"Remote Port:")]
97 [ToolTip(92,
"Port number of remote domain that requests will be forwarded to.")]
105 [Page(7,
"Configuration")]
106 [Header(93,
"Use encryption.")]
107 [ToolTip(94,
"If forwarded requests are encrypted (HTTPS) or not (HTTP).")]
114 [Page(7,
"Configuration")]
115 [Header(95,
"Use proxy-session.")]
116 [ToolTip(96,
"If the proxy uses a session itself.")]
117 [Text(
TextPosition.AfterField, 97,
"Note: By making the proxy use a proxy-session itself, the broker can add SSO token information in forwarded requests, making underlying services aware of the currently logged in user identity.")]
123 [Page(7,
"Configuration")]
124 [Header(34,
"Timeout (ms):")]
125 [ToolTip(98,
"Timeout afforded to forwarded requests, in milliseconds, before they are assumed to have failed.")]
126 [Range(1, 120 * 1000)]
127 [Text(
TextPosition.AfterField, 63,
"Note: Changes will take effect after broker has been restarted.")]
133 [Page(7,
"Configuration")]
134 [Header(247,
"Required Privilege:")]
135 [ToolTip(248,
"Required privilege to access the resource. If not specified, the resource is public.")]
167 LinkedList<Parameter> Parameters =
new LinkedList<Parameter>();
170 StringBuilder sb =
new StringBuilder();
195 #region ICommunicationLayer
209 this.comLayer?.Add(Sniffer);
242 public IEnumerator<ISniffer>
GetEnumerator() => this.comLayer?.GetEnumerator();
248 System.Collections.IEnumerator
System.
Collections.IEnumerable.GetEnumerator() => this.comLayer?.GetEnumerator();
254 public void ReceiveBinary(
int Count) => this.comLayer?.ReceiveBinary(Count);
262 public void ReceiveBinary(
bool ConstantBuffer,
byte[] Data) => this.comLayer?.ReceiveBinary(ConstantBuffer, Data);
272 public void ReceiveBinary(
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count) => this.comLayer?.ReceiveBinary(ConstantBuffer, Data, Offset, Count);
286 public void TransmitBinary(
bool ConstantBuffer,
byte[] Data) => this.comLayer?.TransmitBinary(ConstantBuffer, Data);
296 public void TransmitBinary(
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count) => this.comLayer?.TransmitBinary(ConstantBuffer, Data, Offset, Count);
302 public void ReceiveText(
string Text) => this.comLayer?.ReceiveText(Text);
308 public void TransmitText(
string Text) => this.comLayer?.TransmitText(Text);
314 public void Information(
string Comment) => this.comLayer?.Information(Comment);
332 public void Exception(Exception Exception) => this.comLayer?.Exception(Exception);
338 public void Exception(
string Exception) => this.comLayer?.Exception(Exception);
345 public void ReceiveBinary(DateTime Timestamp,
int Count) => this.comLayer?.ReceiveBinary(Timestamp, Count);
354 public void ReceiveBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data) => this.comLayer?.ReceiveBinary(Timestamp, ConstantBuffer, Data);
365 public void ReceiveBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count) => this.comLayer?.ReceiveBinary(Timestamp, ConstantBuffer, Data, Offset, Count);
372 public void TransmitBinary(DateTime Timestamp,
int Count) => this.comLayer?.TransmitBinary(Timestamp, Count);
381 public void TransmitBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data) => this.comLayer?.TransmitBinary(Timestamp, ConstantBuffer, Data);
392 public void TransmitBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count) => this.comLayer?.TransmitBinary(Timestamp, ConstantBuffer, Data, Offset, Count);
399 public void ReceiveText(DateTime Timestamp,
string Text) => this.comLayer?.ReceiveText(Timestamp, Text);
406 public void TransmitText(DateTime Timestamp,
string Text) => this.comLayer?.TransmitText(Timestamp, Text);
413 public void Information(DateTime Timestamp,
string Comment) => this.comLayer?.Information(Timestamp, Comment);
427 public void Error(DateTime Timestamp,
string Error) => this.comLayer?.Error(Timestamp,
Error);
434 public void Exception(DateTime Timestamp,
string Exception) => this.comLayer?.Exception(Timestamp, Exception);
441 public void Exception(DateTime Timestamp, Exception Exception) => this.comLayer?.Exception(Timestamp, Exception);
Simple base class for classes implementing communication protocols.
Implements an HTTP server.
const int DefaultHttpPort
Default HTTP Port (80).
const int DefaultHttpsPort
Default HTTPS port (443).
Contains information about a language.
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 ...
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Contains information about a namespace in a language.
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Abstract base class for gateway configuration nodes.
virtual INode Parent
Parent Node, or null if a root node.
GatewayConfigSource Source
Source hosting the node.
Data source mirroring the Gateway.config file.
Defines a proxy resource to act as a reverse proxy.
void Information(DateTime Timestamp, string Comment)
Called to inform the viewer of something.
void TransmitBinary(DateTime Timestamp, int Count)
Called when binary data has been transmitted.
void Error(DateTime Timestamp, string Error)
Called to inform the viewer of an error state.
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been received.
void Exception(Exception Exception)
Called to inform the viewer of an exception state.
bool Encrypted
If forwarded requests are encrypted (HTTPS) or not (HTTP).
string RemoteDomain
Location client is redirected to.
void ReceiveBinary(DateTime Timestamp, int Count)
Called when binary data has been received.
void Exception(DateTime Timestamp, Exception Exception)
Called to inform the viewer of an exception state.
override string NodeId
ID of node.
void ReceiveBinary(int Count)
Called when binary data has been received.
void Add(ISniffer Sniffer)
Adds a sniffer to the node.
ProxyResource(GatewayConfigSource Source, WebServer Parent, string LocalResource, string RemoteDomain, string RemoteFolder, int RemotePort, bool Encrypted, bool UseSession, int TimeoutMs, string Privilege, ICommunicationLayer CommunicationLayer)
Defines a proxy resource to act as a reverse proxy.
void TransmitBinary(int Count)
Called when binary data has been transmitted.
void TransmitText(string Text)
Called when text has been transmitted.
bool DecoupledEvents
If events raised from the communication layer are decoupled, i.e. executed in parallel with the sourc...
void AddRange(IEnumerable< ISniffer > Sniffers)
Adds a range of sniffers to the node.
bool Remove(ISniffer Sniffer)
Removes a sniffer, if registered.
void ReceiveText(string Text)
Called when text has been received.
bool UseSession
If forwarded requests are encrypted (HTTPS) or not (HTTP).
void ReceiveText(DateTime Timestamp, string Text)
Called when text has been received.
void ReceiveBinary(bool ConstantBuffer, byte[] Data)
Called when binary data has been received.
string RemoteFolder
If sub-paths should be included in the redirection.
IEnumerator< ISniffer > GetEnumerator()
Returns an enumerator that iterates through the collection.
void Information(string Comment)
Called to inform the viewer of something.
ISniffer[] Sniffers
Registered sniffers.
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data)
Called when binary data has been received.
void TransmitBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been transmitted.
ProxyResource()
Defines a proxy resource to act as a reverse proxy.
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been transmitted.
void Warning(string Warning)
Called to inform the viewer of a warning state.
void Exception(string Exception)
Called to inform the viewer of an exception state.
void ReceiveBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been received.
void Error(string Error)
Called to inform the viewer of an error state.
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
string LocalResource
Resource being redirected.
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data)
Called when binary data has been transmitted.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
int TimeoutMs
If redirection is permanent (true) or temporary (false).
void Warning(DateTime Timestamp, string Warning)
Called to inform the viewer of a warning state.
bool HasSniffers
If there are sniffers registered on the object.
void TransmitBinary(bool ConstantBuffer, byte[] Data)
Called when binary data has been transmitted.
void TransmitText(DateTime Timestamp, string Text)
Called when text has been transmitted.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
void Exception(DateTime Timestamp, string Exception)
Called to inform the viewer of an exception state.
int RemotePort
If redirection is permanent (true) or temporary (false).
string Privilege
Required privilege to access the resource. If not specified, the resource is public.
Settings for the Web Server.
Boolean-valued parameter.
Tokens available in request.
Interface for observable classes implementing communication protocols.
Interface for sniffers. Sniffers can be added to ICommunicationLayer classes to eavesdrop on communic...
Interface for nodes that are published through the concentrator interface.
TextPosition
Where the instructions are to be place.