TROSuperHTTPServer

Overview

This Super HTTP Server implements the server side of the new and enhanced HTTP based channel which provides a sophisticated and flexible communication channel that uses persistent connections to enable true asynchronous calls and server callbacks.

Location

 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

AccessControlMaxAge    (declared in TROCustomHTTPServer)

property AccessControlMaxAge: Integer read write

Active    (declared in TROServer)

Toggles whether the server ready to receive requests from clients. Depending on the server type, changing this property might open/close a network socket or otherwise toggle whether the server will process incoming requests.

property Active: Boolean read write

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

AutoRegisterSession    (declared in TROBaseSuperHTTPServer)

This property is used by the server to automatically sign new clients up to the event repository, thus making it possible for them to receive events without manual registration. The default value is true.

property AutoRegisterSession: Boolean read write

BindV4

Gets or sets the flag indicating whether the server should listen for IPv4 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true).

property BindV4: Boolean read write

BindV6

Gets or sets the flag indicating whether the server should listen for IPv6 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true).

property BindV6: Boolean read write

CheckProperties  virtual    (declared in TROServer)

Validates the server properties.

procedure CheckProperties

CloseConnection  protected override

Closes the specified connection when overridden.

procedure CloseConnection(aConnection: IROHTTPClientCapabilities)

Parameters:

  • aConnection: Specified connection

ConnectionTimeout    (declared in TROBaseSuperHTTPServer)

The timeout, in seconds, after which the idle connection will be closed.

The default value is 300 (i.e. 5 minutes).

property ConnectionTimeout: Integer read write

DecryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

DecryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

DefaultResponse  protected    (declared in TROServer)

Holds the message that will be sent back to the client if it improperly "welcomes" the server.

property DefaultResponse: string read write

DisableNagle

Controls whether data packets are sent individually or if small packets are held back to send as part of fewer larger data packets. Normally, you will want this disabled as it can have a significant effect on performance. The only time when its worth keeping the property enabled is when there are many small packets to be sent and you need to keep network bandwidth to a minimum.

See more at Nagle's algorithm

property DisableNagle: Boolean read write

Dispatchers    (declared in TROServer)

Specifies how incoming requests will be processed and dispatched. Depending on the server type, one or multiple dispatchers can be configured to receive messages from the client. Each dispatcher consists of a Message and an optional Name. Also, each dispatcher can be individually enabled or disabled. Each server must have at least one dispatcher configured, in order to be able to process messages.

=Essential Sub-Properties=

  • Message specifies the message format to be used for this dispatcher.
  • Name specifies the name, or possibly the URL for the dispatcher.

In HTTP based servers (such as the TROIndyHTTPServer, the Name will be appended as folder to the server URL allowing the server to make multiple dispatchers available at different URLs.

property Dispatchers: TROMessageDispatchers read write

DispatchMessage (IROTransport, TStream, TStream): Boolean  protected overload    (declared in TROServer)

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:

DispatchMessage (IROTransport, TStream, TStream, TROResponseOptions): Boolean  protected overload    (declared in TROServer)

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

DoActivate  protected override

Activates the current HTTP server.

procedure DoActivate

DoBeforeDecryptEvent  protected virtual    (declared in TROBaseConnection) obsolete

procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)

Parameters:

  • aEncryptedStream: Stream

DoCORSSupport  protected    (declared in TROCustomHTTPServer)

Processes CORS requests.

function DoCORSSupport(const aRequest: IUnknown; const aResponse: IROHTTPResponse): Boolean

Parameters:

  • aRequest: Request
  • aResponse: Response

DoDeactivate  protected override

Deactivates the current HTTP server.

procedure DoDeactivate

DoGetCustomClientAccessPolicy  protected    (declared in TROCustomHTTPServer)

procedure DoGetCustomClientAccessPolicy(var aPolicyContent: string)

Parameters:

  • aPolicyContent:

DoProcessDocs  protected    (declared in TROCustomHTTPServer)

Generates documentation if correspondent request is detected

function DoProcessDocs(const aRequest: IUnknown; const aResponse: IROHTTPResponse; const aResponseStream: TStream; const aRoot: string; const aSub: string): Boolean

Parameters:

  • aRequest: Request
  • aResponse: Response
  • aResponseStream: Response stream
  • aRoot: Root (part before ?)
  • aSub: Query string (part after ?)

Encryption    (declared in TROBaseConnection) obsolete

This is DES based enscryption, it is obsolete because works only for Delphi. Use message envelope AES Encryption Envelope instead.

property Encryption: TROEncryption read write

EncryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

EncryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

EventRepository    (declared in TROBaseSuperHTTPServer)

Represents the specified event repository object for the current server.

property EventRepository: TROEventRepository read write

ExtendedDispatchers    (declared in TROCustomHTTPServer)

List of extended dispatchers attached to the server channel instance.

Extended dispatchers are dispatchers that perform special tasks other than calling server services. A good example of an extended dispatcher is TROJavaScriptHttpDispatcher dispatcher.

property ExtendedDispatchers: TROExtendedHTTPDispatcherList read

GetCACertificate  protected override

Returns CA certificate

function GetCACertificate: string

GetDispatchersClass  protected override    (declared in TROCustomHTTPServer)

Returns TROMessageDispatchers class

function GetDispatchersClass: TROMessageDispatchersClass

GetRODLReader  protected    (declared in TROServer)

function GetRODLReader: TROCustomRODLReader

GetSecure  protected override

Returns SSL state

function GetSecure: Boolean

GetServerType  protected override

Returns rstSuperHTTP. This property is used by the ZeroConf infrastructure.

function GetServerType: TROServerType

GetServiceMetaData  protected    (declared in TROServer)

function GetServiceMetaData(aServiceName: string; aOptions: string; out aContentType: string): TStream

Parameters:

  • aServiceName:
  • aOptions:
  • aContentType:

GetTransportObject  protected    (declared in TROServer)

Returns itself.

function GetTransportObject: TObject

HandleExtendedDispatchers  protected    (declared in TROCustomHTTPServer)

Processes Extended Dispatcher requests.

function HandleExtendedDispatchers(const aRoot: string; const aTransport: IROHTTPTransport; const aRequest: IUnknown; const aResponse: IROHTTPResponse; const aRequestData: TStream; const aResponseData: TStream): Boolean

Parameters:

  • aRoot: Path Info
  • aTransport: Transport channel
  • aRequest: Request
  • aResponse: Response
  • aRequestData: Request stream
  • aResponseData: Response stream

HandlePlainRequests    (declared in TROBaseSuperHTTPServer)

Gets or sets a flag indicating whether the server should accept plain Http requests to the services exposed by the server.

property HandlePlainRequests: Boolean read write

HandleRequest  protected    (declared in TROBaseSuperHTTPServer)

Processes incoming HTTP requests and performs requested actions (service method call, RODL request, etc.).

procedure HandleRequest(aTarget: IROHTTPClientCapabilities; aRequestHeaders: TIPHTTPRequestHeaders; aRequest: TBytes)

Parameters:

  • aTarget: Target to send the response to
  • aRequestHeaders: Collection of request headers
  • aRequest: Client's request

HandleUnknownRequest  protected override

This method will be overridden to process HTTP requests with a path, containing an unknown message dispatcher.

function HandleUnknownRequest(aTarget: IROHTTPClientCapabilities; arequest: TIPHTTPRequestHeaders; aData: TBytes): Boolean

Parameters:

  • aTarget: Target to send the response to
  • arequest: Collection of request headers
  • aData: Body of the request

IntBeforeCleanupContext  protected

procedure IntBeforeCleanupContext(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntDispatchMessage  protected    (declared in TROServer)

function IntDispatchMessage(Dispatcher: TROMessageDispatcher; const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • Dispatcher:
  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

IntRequest  protected

procedure IntRequest(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntResponseFailed  protected

procedure IntResponseFailed(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntResponseSent  protected

procedure IntResponseSent(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IsEncryptionUsed  protected    (declared in TROBaseConnection)

Checks if encryption was used

function IsEncryptionUsed: Boolean

IsServiceAllowed  protected    (declared in TROServer)

function IsServiceAllowed(Value: string): Boolean

Parameters:

  • Value:

IsStreamEncrypted  protected    (declared in TROBaseConnection)

Checks state of stream

function IsStreamEncrypted(Source: TStream): Boolean

Parameters:

  • Source: Stream

MaxPackageSize    (declared in TROBaseSuperHTTPServer)

Sets the maximum size of data package that the server will receive (default is 10485760, i.e. 10MB). This is to prevent a larger package than intended from being sent to the server.

property MaxPackageSize: Integer read write

MaxPostData

Determines the maximum length of client's request data (checks the value of the request Content-Length header). By default, this property equals 10MB.

property MaxPostData: Integer read write

MinSizeForGzipEncoding    (declared in TROCustomHTTPServer)

The minimal size when GZIP encoding will be used (default is 4096 bytes)

property MinSizeForGzipEncoding: Integer read write

Notification  protected override    (declared in TROServer)

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

OnAfterEncrypt    (declared in TROBaseConnection)

Fired after stream was encrypted

property OnAfterEncrypt: TROBaseConnectionOperation read write
delegate: procedure OnAfterEncrypt(Sender: TROBaseConnection; aEncryptedStream: TStream)

OnAfterServerActivate    (declared in TROServer)

Fires after the server has been activated.

property OnAfterServerActivate: TNotifyEvent read write

OnAfterServerDeactivate    (declared in TROServer)

Fires after the server has been deactivated. You can use this event handler to perform any cleanup you might need after the server has stopped processing new requests.

property OnAfterServerDeactivate: TNotifyEvent read write

OnBeforeDecrypt    (declared in TROBaseConnection)

Fired before stream will be decrypted

property OnBeforeDecrypt: TROBaseConnectionOperation read write
delegate: procedure OnBeforeDecrypt(Sender: TROBaseConnection; aEncryptedStream: TStream)

OnBeforeServerActivate    (declared in TROServer)

Fires just before the server is activated. You can use this event handler to perform any initialization you might need before the server starts processing new requests.

property OnBeforeServerActivate: TNotifyEvent read write

OnBeforeServerDeactivate    (declared in TROServer)

Fires just before the server is deactivated. You can use this event handler to perform any cleanup you might need before the server stops processing new requests.

property OnBeforeServerDeactivate: TNotifyEvent read write

OnCertificateGenerating

property OnCertificateGenerating: TROOpenSSLCertificateGenerating read write
delegate: procedure OnCertificateGenerating(var Subject: string; var Issuer: string; var HashAlgorithm: string; var BitNumber: Word)

OnGetCustomClientAccessPolicy    (declared in TROCustomHTTPServer)

This event is fired when SendClientAccessPolicyXml is set to captCustom. Allows more precise management of client access policies.

The handler of this event generates a valid ClientAccessPolicy.xml and puts it to the aPolicyContent parameter.

property OnGetCustomClientAccessPolicy: TROCustomClientAccessPolicyMethod read write
delegate: procedure OnGetCustomClientAccessPolicy(aSender: TObject; var aPolicyContent: ROUTF8String)

OnGetRODLReader    (declared in TROCustomHTTPServer)

property OnGetRODLReader: TROGetRODLReader read write

OnManualBindSocket

Allows to customize the binding of the server to the host's IP addresses. By default the server is bound to all addresses available. When this event is handled by the user code no automatic binding is performed, the binding becomes user's responsibility.

property OnManualBindSocket: TNotifyEvent read write

OnPassword

Asks SSL certificate's password

property OnPassword: TROOpenSSLPassword read write
delegate: procedure OnPassword(Sender: TROOpenSSL; var aPassword: string; const IsWrite: Boolean)

OnReadFromStream    (declared in TROServer)

Fires after a stream with a request message has been received from the client. The event handler can inspect and possibly modify the stream, before it continues to be processed by the higher levels of the Remoting SDK framework.

property OnReadFromStream: TStreamOperation read write
delegate: procedure OnReadFromStream(aStream: TStream)

OnSendCrossOriginHeader    (declared in TROCustomHTTPServer)

This event is fired when server channel receives OPTIONS request. This event allows more precise management of cross-origin client access policies.

property OnSendCrossOriginHeader: TROHTTPSendCrossOriginHeader read write
delegate: procedure OnSendCrossOriginHeader(var AllowedOrigin: string)

OnSendCrossOriginHeaderEx    (declared in TROCustomHTTPServer)

property OnSendCrossOriginHeaderEx: TROHTTPSendCrossOriginHeaderEx read write
delegate: function OnSendCrossOriginHeaderEx(var Cors: TROCorsStruct): Boolean

OnUnknownRequest

property OnUnknownRequest: TROAsyncHTTPRequestHandler read write
delegate: procedure OnUnknownRequest(Sender: TObject; aContext: IROAsyncContext)

OnVerifyCeft

Verificates certificate

property OnVerifyCeft: TROOpenSSLVerifyCeft read write
delegate: procedure OnVerifyCeft(anIssuer: string; aSubject: string; aSerial: Cardinal; ErrorCode: Cardinal; Depth: Cardinal; var Ok: Boolean)

OnWriteToStream    (declared in TROServer)

Fires just before a stream with a response message is sent back to the client. The event handler can inspect and possibly modify the stream, before it continues to be sent off to the client.

property OnWriteToStream: TStreamOperation read write
delegate: procedure OnWriteToStream(aStream: TStream)

OpenSSL

Specifies SSL properties

property OpenSSL: TROOpenSSL read write

ParsePathInfo  protected    (declared in TROCustomHTTPServer)

Parses PathInfo and splits it to root and query

procedure ParsePathInfo(const aPathInfo: string; var aRoot: string; var aSub: string)

Parameters:

  • aPathInfo: PathInfo
  • aRoot: Root (part after ?)
  • aSub: Query string (part after ?)

Port

Specifies the TCP port that the server is listening on. By default, the Remoting SDK HTTP Servers use port 8099 to avoid conflicts with existing web servers running on port 80, but you can change this to any other value that is available on your system.

property Port: Integer read write

Register  protected    (declared in TROCustomHTTPServer)

Register Extended HTTP Dispatcher

procedure Register(aDispatcher: IROHTTPDispatcher)

Parameters:

  • aDispatcher: Extended HTTP Dispatcher

ResponseFailed  protected    (declared in TROBaseSuperHTTPServer)

This method should be called by the descendants when a response has not successfully been sent.

procedure ResponseFailed(aUserData: IInterface)

Parameters:

  • aUserData: Specified failed message

ResponseSucessful  protected    (declared in TROBaseSuperHTTPServer)

Does nothing.

procedure ResponseSucessful(aUserData: IInterface)

Parameters:

  • aUserData: Specified user data

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendClientAccessPolicyXml    (declared in TROCustomHTTPServer)

Gets or sets the intended server behavior when the ClientAccessPolicy.xml file (security policy file) is requested.

Possible values are:

property SendClientAccessPolicyXml: TROClientAccessPolicyType read write

SendCrossOriginHeader    (declared in TROCustomHTTPServer)

Gets or sets a flag indicating whether the server should handle the incoming CORS requests or ignore them.

property SendCrossOriginHeader: Boolean read write

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendResponse  protected override

Sends an HTTP response data back to the client when overridden.

procedure SendResponse(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders; aData: TBytes; UserData: IInterface; aUseGZIPEncoding: Boolean)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Collection of response headers
  • aData: HTTP response data
  • UserData: User data information
  • aUseGZIPEncoding: Use GZIP encoding or not.

ServeInfoPage    (declared in TROCustomHTTPServer)

Specifies whether the HTTP server will serve up a page with human-readable information about the server when being accessed from a web browser. This information page will contain details about the registered dispatchers and the documentation for the services.

property ServeInfoPage: Boolean read write

ServerName

property ServerName: string read write

ServeRodl    (declared in TROServer)

Specifies whether the server will make the contained RODL file available to clients (true, default) or not. Keep this property set to true if clients need to access the RODL (or WSDL), for example so that third parties (including Service Tester) can import services. Set it to false if you do not want to provide this information, for example for security reasons.

property ServeRodl: Boolean read write

ServiceGroup    (declared in TROServer)

Allows to get/set Service Groups

property ServiceGroup: string read write

SetDefaultHeaders  protected override

Sets the default HTTP headers of the response when overridden.

procedure SetDefaultHeaders(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Collection of HTTP headers

SocketTimeout

property SocketTimeout: Integer read write

ThreadPool    (declared in TROBaseSuperHTTPServer)

Allows to set a custom thread pool object to process incoming requests using a set of threads. When not assigned explicitly the thread pool is created and assigned automatically. Assigning this property by users is a rare need, this is required only when precise and/or custom control over processing threads is necessary.

property ThreadPool: TROThreadPool read write

TriggerReadFromStream  protected    (declared in TROServer)

Fires the OnReadFromStream event

procedure TriggerReadFromStream(aSource: TStream)

Parameters:

  • aSource: stream

TriggerWriteToStream  protected    (declared in TROServer)

Fires the OnReadFromStream event

procedure TriggerWriteToStream(aDest: TStream)

Parameters:

  • aDest: stream

TryEncodeData  protected    (declared in TROBaseSuperHTTPServer)

Encodes data with GZIP encription is needed

procedure TryEncodeData(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders; aSourceData: TBytes; out aDestData: TBytes; aUseGZIPEncoding: Boolean)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Response headers
  • aSourceData: Source
  • aDestData: Destination
  • aUseGZIPEncoding: Use GZIP encoding

Unregister  protected    (declared in TROCustomHTTPServer)

Unregister Extended HTTP Dispatcher

procedure Unregister(aDispatcher: IROHTTPDispatcher)

Parameters:

  • aDispatcher: Extended HTTP Dispatcher

 

AccessControlMaxAge    (declared in TROCustomHTTPServer)

property AccessControlMaxAge: Integer read write

Active    (declared in TROServer)

Toggles whether the server ready to receive requests from clients. Depending on the server type, changing this property might open/close a network socket or otherwise toggle whether the server will process incoming requests.

property Active: Boolean read write

AutoRegisterSession    (declared in TROBaseSuperHTTPServer)

This property is used by the server to automatically sign new clients up to the event repository, thus making it possible for them to receive events without manual registration. The default value is true.

property AutoRegisterSession: Boolean read write

BindV4

Gets or sets the flag indicating whether the server should listen for IPv4 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true).

property BindV4: Boolean read write

BindV6

Gets or sets the flag indicating whether the server should listen for IPv6 connections.

Setting this flag doesn't have any immediate effect. Its value is used only when the server is opened (either by setting the Active property to true).

property BindV6: Boolean read write

ConnectionTimeout    (declared in TROBaseSuperHTTPServer)

The timeout, in seconds, after which the idle connection will be closed.

The default value is 300 (i.e. 5 minutes).

property ConnectionTimeout: Integer read write

DefaultResponse  protected    (declared in TROServer)

Holds the message that will be sent back to the client if it improperly "welcomes" the server.

property DefaultResponse: string read write

DisableNagle

Controls whether data packets are sent individually or if small packets are held back to send as part of fewer larger data packets. Normally, you will want this disabled as it can have a significant effect on performance. The only time when its worth keeping the property enabled is when there are many small packets to be sent and you need to keep network bandwidth to a minimum.

See more at Nagle's algorithm

property DisableNagle: Boolean read write

Dispatchers    (declared in TROServer)

Specifies how incoming requests will be processed and dispatched. Depending on the server type, one or multiple dispatchers can be configured to receive messages from the client. Each dispatcher consists of a Message and an optional Name. Also, each dispatcher can be individually enabled or disabled. Each server must have at least one dispatcher configured, in order to be able to process messages.

=Essential Sub-Properties=

  • Message specifies the message format to be used for this dispatcher.
  • Name specifies the name, or possibly the URL for the dispatcher.

In HTTP based servers (such as the TROIndyHTTPServer, the Name will be appended as folder to the server URL allowing the server to make multiple dispatchers available at different URLs.

property Dispatchers: TROMessageDispatchers read write

Encryption    (declared in TROBaseConnection) obsolete

This is DES based enscryption, it is obsolete because works only for Delphi. Use message envelope AES Encryption Envelope instead.

property Encryption: TROEncryption read write

EventRepository    (declared in TROBaseSuperHTTPServer)

Represents the specified event repository object for the current server.

property EventRepository: TROEventRepository read write

ExtendedDispatchers    (declared in TROCustomHTTPServer)

List of extended dispatchers attached to the server channel instance.

Extended dispatchers are dispatchers that perform special tasks other than calling server services. A good example of an extended dispatcher is TROJavaScriptHttpDispatcher dispatcher.

property ExtendedDispatchers: TROExtendedHTTPDispatcherList read

HandlePlainRequests    (declared in TROBaseSuperHTTPServer)

Gets or sets a flag indicating whether the server should accept plain Http requests to the services exposed by the server.

property HandlePlainRequests: Boolean read write

MaxPackageSize    (declared in TROBaseSuperHTTPServer)

Sets the maximum size of data package that the server will receive (default is 10485760, i.e. 10MB). This is to prevent a larger package than intended from being sent to the server.

property MaxPackageSize: Integer read write

MaxPostData

Determines the maximum length of client's request data (checks the value of the request Content-Length header). By default, this property equals 10MB.

property MaxPostData: Integer read write

MinSizeForGzipEncoding    (declared in TROCustomHTTPServer)

The minimal size when GZIP encoding will be used (default is 4096 bytes)

property MinSizeForGzipEncoding: Integer read write

OnGetRODLReader    (declared in TROCustomHTTPServer)

property OnGetRODLReader: TROGetRODLReader read write

OpenSSL

Specifies SSL properties

property OpenSSL: TROOpenSSL read write

Port

Specifies the TCP port that the server is listening on. By default, the Remoting SDK HTTP Servers use port 8099 to avoid conflicts with existing web servers running on port 80, but you can change this to any other value that is available on your system.

property Port: Integer read write

SendClientAccessPolicyXml    (declared in TROCustomHTTPServer)

Gets or sets the intended server behavior when the ClientAccessPolicy.xml file (security policy file) is requested.

Possible values are:

property SendClientAccessPolicyXml: TROClientAccessPolicyType read write

SendCrossOriginHeader    (declared in TROCustomHTTPServer)

Gets or sets a flag indicating whether the server should handle the incoming CORS requests or ignore them.

property SendCrossOriginHeader: Boolean read write

ServeInfoPage    (declared in TROCustomHTTPServer)

Specifies whether the HTTP server will serve up a page with human-readable information about the server when being accessed from a web browser. This information page will contain details about the registered dispatchers and the documentation for the services.

property ServeInfoPage: Boolean read write

ServerName

property ServerName: string read write

ServeRodl    (declared in TROServer)

Specifies whether the server will make the contained RODL file available to clients (true, default) or not. Keep this property set to true if clients need to access the RODL (or WSDL), for example so that third parties (including Service Tester) can import services. Set it to false if you do not want to provide this information, for example for security reasons.

property ServeRodl: Boolean read write

ServiceGroup    (declared in TROServer)

Allows to get/set Service Groups

property ServiceGroup: string read write

SocketTimeout

property SocketTimeout: Integer read write

ThreadPool    (declared in TROBaseSuperHTTPServer)

Allows to set a custom thread pool object to process incoming requests using a set of threads. When not assigned explicitly the thread pool is created and assigned automatically. Assigning this property by users is a rare need, this is required only when precise and/or custom control over processing threads is necessary.

property ThreadPool: TROThreadPool read write

 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

CheckProperties  virtual    (declared in TROServer)

Validates the server properties.

procedure CheckProperties

CloseConnection  protected override

Closes the specified connection when overridden.

procedure CloseConnection(aConnection: IROHTTPClientCapabilities)

Parameters:

  • aConnection: Specified connection

DecryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

DecryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

DispatchMessage (IROTransport, TStream, TStream): Boolean  protected overload    (declared in TROServer)

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:

DispatchMessage (IROTransport, TStream, TStream, TROResponseOptions): Boolean  protected overload    (declared in TROServer)

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

DoActivate  protected override

Activates the current HTTP server.

procedure DoActivate

DoBeforeDecryptEvent  protected virtual    (declared in TROBaseConnection) obsolete

procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)

Parameters:

  • aEncryptedStream: Stream

DoCORSSupport  protected    (declared in TROCustomHTTPServer)

Processes CORS requests.

function DoCORSSupport(const aRequest: IUnknown; const aResponse: IROHTTPResponse): Boolean

Parameters:

  • aRequest: Request
  • aResponse: Response

DoDeactivate  protected override

Deactivates the current HTTP server.

procedure DoDeactivate

DoGetCustomClientAccessPolicy  protected    (declared in TROCustomHTTPServer)

procedure DoGetCustomClientAccessPolicy(var aPolicyContent: string)

Parameters:

  • aPolicyContent:

DoProcessDocs  protected    (declared in TROCustomHTTPServer)

Generates documentation if correspondent request is detected

function DoProcessDocs(const aRequest: IUnknown; const aResponse: IROHTTPResponse; const aResponseStream: TStream; const aRoot: string; const aSub: string): Boolean

Parameters:

  • aRequest: Request
  • aResponse: Response
  • aResponseStream: Response stream
  • aRoot: Root (part before ?)
  • aSub: Query string (part after ?)

EncryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

EncryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

GetCACertificate  protected override

Returns CA certificate

function GetCACertificate: string

GetDispatchersClass  protected override    (declared in TROCustomHTTPServer)

Returns TROMessageDispatchers class

function GetDispatchersClass: TROMessageDispatchersClass

GetRODLReader  protected    (declared in TROServer)

function GetRODLReader: TROCustomRODLReader

GetSecure  protected override

Returns SSL state

function GetSecure: Boolean

GetServerType  protected override

Returns rstSuperHTTP. This property is used by the ZeroConf infrastructure.

function GetServerType: TROServerType

GetServiceMetaData  protected    (declared in TROServer)

function GetServiceMetaData(aServiceName: string; aOptions: string; out aContentType: string): TStream

Parameters:

  • aServiceName:
  • aOptions:
  • aContentType:

GetTransportObject  protected    (declared in TROServer)

Returns itself.

function GetTransportObject: TObject

HandleExtendedDispatchers  protected    (declared in TROCustomHTTPServer)

Processes Extended Dispatcher requests.

function HandleExtendedDispatchers(const aRoot: string; const aTransport: IROHTTPTransport; const aRequest: IUnknown; const aResponse: IROHTTPResponse; const aRequestData: TStream; const aResponseData: TStream): Boolean

Parameters:

  • aRoot: Path Info
  • aTransport: Transport channel
  • aRequest: Request
  • aResponse: Response
  • aRequestData: Request stream
  • aResponseData: Response stream

HandleRequest  protected    (declared in TROBaseSuperHTTPServer)

Processes incoming HTTP requests and performs requested actions (service method call, RODL request, etc.).

procedure HandleRequest(aTarget: IROHTTPClientCapabilities; aRequestHeaders: TIPHTTPRequestHeaders; aRequest: TBytes)

Parameters:

  • aTarget: Target to send the response to
  • aRequestHeaders: Collection of request headers
  • aRequest: Client's request

HandleUnknownRequest  protected override

This method will be overridden to process HTTP requests with a path, containing an unknown message dispatcher.

function HandleUnknownRequest(aTarget: IROHTTPClientCapabilities; arequest: TIPHTTPRequestHeaders; aData: TBytes): Boolean

Parameters:

  • aTarget: Target to send the response to
  • arequest: Collection of request headers
  • aData: Body of the request

IntBeforeCleanupContext  protected

procedure IntBeforeCleanupContext(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntDispatchMessage  protected    (declared in TROServer)

function IntDispatchMessage(Dispatcher: TROMessageDispatcher; const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • Dispatcher:
  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

IntRequest  protected

procedure IntRequest(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntResponseFailed  protected

procedure IntResponseFailed(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IntResponseSent  protected

procedure IntResponseSent(Sender: TObject; aContext: IROAsyncContext)

Parameters:

  • Sender:
  • aContext:

IsEncryptionUsed  protected    (declared in TROBaseConnection)

Checks if encryption was used

function IsEncryptionUsed: Boolean

IsServiceAllowed  protected    (declared in TROServer)

function IsServiceAllowed(Value: string): Boolean

Parameters:

  • Value:

IsStreamEncrypted  protected    (declared in TROBaseConnection)

Checks state of stream

function IsStreamEncrypted(Source: TStream): Boolean

Parameters:

  • Source: Stream

Notification  protected override    (declared in TROServer)

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

ParsePathInfo  protected    (declared in TROCustomHTTPServer)

Parses PathInfo and splits it to root and query

procedure ParsePathInfo(const aPathInfo: string; var aRoot: string; var aSub: string)

Parameters:

  • aPathInfo: PathInfo
  • aRoot: Root (part after ?)
  • aSub: Query string (part after ?)

Register  protected    (declared in TROCustomHTTPServer)

Register Extended HTTP Dispatcher

procedure Register(aDispatcher: IROHTTPDispatcher)

Parameters:

  • aDispatcher: Extended HTTP Dispatcher

ResponseFailed  protected    (declared in TROBaseSuperHTTPServer)

This method should be called by the descendants when a response has not successfully been sent.

procedure ResponseFailed(aUserData: IInterface)

Parameters:

  • aUserData: Specified failed message

ResponseSucessful  protected    (declared in TROBaseSuperHTTPServer)

Does nothing.

procedure ResponseSucessful(aUserData: IInterface)

Parameters:

  • aUserData: Specified user data

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendResponse  protected override

Sends an HTTP response data back to the client when overridden.

procedure SendResponse(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders; aData: TBytes; UserData: IInterface; aUseGZIPEncoding: Boolean)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Collection of response headers
  • aData: HTTP response data
  • UserData: User data information
  • aUseGZIPEncoding: Use GZIP encoding or not.

SetDefaultHeaders  protected override

Sets the default HTTP headers of the response when overridden.

procedure SetDefaultHeaders(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Collection of HTTP headers

TriggerReadFromStream  protected    (declared in TROServer)

Fires the OnReadFromStream event

procedure TriggerReadFromStream(aSource: TStream)

Parameters:

  • aSource: stream

TriggerWriteToStream  protected    (declared in TROServer)

Fires the OnReadFromStream event

procedure TriggerWriteToStream(aDest: TStream)

Parameters:

  • aDest: stream

TryEncodeData  protected    (declared in TROBaseSuperHTTPServer)

Encodes data with GZIP encription is needed

procedure TryEncodeData(aTarget: IROHTTPClientCapabilities; aHeaders: TIPHTTPResponseHeaders; aSourceData: TBytes; out aDestData: TBytes; aUseGZIPEncoding: Boolean)

Parameters:

  • aTarget: Target to send the response to
  • aHeaders: Response headers
  • aSourceData: Source
  • aDestData: Destination
  • aUseGZIPEncoding: Use GZIP encoding

Unregister  protected    (declared in TROCustomHTTPServer)

Unregister Extended HTTP Dispatcher

procedure Unregister(aDispatcher: IROHTTPDispatcher)

Parameters:

  • aDispatcher: Extended HTTP Dispatcher

 

OnAfterEncrypt    (declared in TROBaseConnection)

Fired after stream was encrypted

property OnAfterEncrypt: TROBaseConnectionOperation read write
delegate: procedure OnAfterEncrypt(Sender: TROBaseConnection; aEncryptedStream: TStream)

OnAfterServerActivate    (declared in TROServer)

Fires after the server has been activated.

property OnAfterServerActivate: TNotifyEvent read write

OnAfterServerDeactivate    (declared in TROServer)

Fires after the server has been deactivated. You can use this event handler to perform any cleanup you might need after the server has stopped processing new requests.

property OnAfterServerDeactivate: TNotifyEvent read write

OnBeforeDecrypt    (declared in TROBaseConnection)

Fired before stream will be decrypted

property OnBeforeDecrypt: TROBaseConnectionOperation read write
delegate: procedure OnBeforeDecrypt(Sender: TROBaseConnection; aEncryptedStream: TStream)

OnBeforeServerActivate    (declared in TROServer)

Fires just before the server is activated. You can use this event handler to perform any initialization you might need before the server starts processing new requests.

property OnBeforeServerActivate: TNotifyEvent read write

OnBeforeServerDeactivate    (declared in TROServer)

Fires just before the server is deactivated. You can use this event handler to perform any cleanup you might need before the server stops processing new requests.

property OnBeforeServerDeactivate: TNotifyEvent read write

OnCertificateGenerating

property OnCertificateGenerating: TROOpenSSLCertificateGenerating read write
delegate: procedure OnCertificateGenerating(var Subject: string; var Issuer: string; var HashAlgorithm: string; var BitNumber: Word)

OnGetCustomClientAccessPolicy    (declared in TROCustomHTTPServer)

This event is fired when SendClientAccessPolicyXml is set to captCustom. Allows more precise management of client access policies.

The handler of this event generates a valid ClientAccessPolicy.xml and puts it to the aPolicyContent parameter.

property OnGetCustomClientAccessPolicy: TROCustomClientAccessPolicyMethod read write
delegate: procedure OnGetCustomClientAccessPolicy(aSender: TObject; var aPolicyContent: ROUTF8String)

OnManualBindSocket

Allows to customize the binding of the server to the host's IP addresses. By default the server is bound to all addresses available. When this event is handled by the user code no automatic binding is performed, the binding becomes user's responsibility.

property OnManualBindSocket: TNotifyEvent read write

OnPassword

Asks SSL certificate's password

property OnPassword: TROOpenSSLPassword read write
delegate: procedure OnPassword(Sender: TROOpenSSL; var aPassword: string; const IsWrite: Boolean)

OnReadFromStream    (declared in TROServer)

Fires after a stream with a request message has been received from the client. The event handler can inspect and possibly modify the stream, before it continues to be processed by the higher levels of the Remoting SDK framework.

property OnReadFromStream: TStreamOperation read write
delegate: procedure OnReadFromStream(aStream: TStream)

OnSendCrossOriginHeader    (declared in TROCustomHTTPServer)

This event is fired when server channel receives OPTIONS request. This event allows more precise management of cross-origin client access policies.

property OnSendCrossOriginHeader: TROHTTPSendCrossOriginHeader read write
delegate: procedure OnSendCrossOriginHeader(var AllowedOrigin: string)

OnSendCrossOriginHeaderEx    (declared in TROCustomHTTPServer)

property OnSendCrossOriginHeaderEx: TROHTTPSendCrossOriginHeaderEx read write
delegate: function OnSendCrossOriginHeaderEx(var Cors: TROCorsStruct): Boolean

OnUnknownRequest

property OnUnknownRequest: TROAsyncHTTPRequestHandler read write
delegate: procedure OnUnknownRequest(Sender: TObject; aContext: IROAsyncContext)

OnVerifyCeft

Verificates certificate

property OnVerifyCeft: TROOpenSSLVerifyCeft read write
delegate: procedure OnVerifyCeft(anIssuer: string; aSubject: string; aSerial: Cardinal; ErrorCode: Cardinal; Depth: Cardinal; var Ok: Boolean)

OnWriteToStream    (declared in TROServer)

Fires just before a stream with a response message is sent back to the client. The event handler can inspect and possibly modify the stream, before it continues to be sent off to the client.

property OnWriteToStream: TStreamOperation read write
delegate: procedure OnWriteToStream(aStream: TStream)