Class TBrookHTTPServer

Unit

Declaration

type TBrookHTTPServer = class(TBrookHandledComponent)

Description

Fast event-driven HTTP(S) server class.

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Open;
Public procedure Close;

Properties

Public property MHDHandle: Pointer read GetMHDHandle;
Published property Active: Boolean read FActive write SetActive stored IsActiveStored;
Published property Authenticated: Boolean read FAuthenticated write SetAuthenticated stored IsAuthenticatedStored;
Published property HostName: string read FHostName write SetHostName stored IsHostNameStored;
Published property Port: UInt16 read GetPort write SetPort stored IsPortStored default 0;
Published property Backlog: Word read FBacklog write SetBacklog stored IsBacklogStored default BROOK_BACKLOG;
Published property Threaded: Boolean read GetThreaded write SetThreaded stored IsThreadedStored default False;
Published property UploadsDir: string read GetUploadsDir write SetUploadsDir stored IsUploadsDirStored;
Published property PostBufferSize: NativeUInt read GetPostBufferSize write SetPostBufferSize stored IsPostBufferSizeStored default BROOK_POST_BUFFER_SIZE;
Published property PayloadLimit: NativeUInt read GetPayloadLimit write SetPayloadLimit stored IsPayloadLimitStored default BROOK_PAYLOAD_LIMIT;
Published property UploadsLimit: UInt64 read GetUploadsLimit write SetUploadsLimit stored IsUploadsLimitStored default BROOK_UPLOADS_LIMIT;
Published property ThreadPoolSize: Cardinal read GetThreadPoolSize write SetThreadPoolSize stored IsThreadPoolSizeStored default 0;
Published property ConnectionTimeout: Cardinal read GetConnectionTimeout write SetConnectionTimeout stored IsConnectionTimeoutStored default 0;
Published property ConnectionLimit: Cardinal read GetConnectionLimit write SetConnectionLimit stored IsConnectionLimitStored default 0;
Published property NoFavicon: Boolean read FNoFavicon write FNoFavicon stored IsNoFaviconStored default False;
Published property Security: TBrookHTTPServerSecurity read FSecurity write SetSecurity;
Published property OnAuthenticate: TBrookHTTPAuthenticateEvent read FOnAuthenticate write FOnAuthenticate;
Published property OnAuthenticateError: TBrookHTTPAuthenticateErrorEvent read FOnAuthenticateError write FOnAuthenticateError;
Published property OnRequest: TBrookHTTPRequestEvent read FOnRequest write FOnRequest;
Published property OnRequestError: TBrookHTTPRequestErrorEvent read FOnRequestError write FOnRequestError;
Published property OnClientConnection: TBrookHTTPServerClientConnectionEvent read FOnClientConnection write FOnClientConnection;
Published property OnError: TBrookErrorEvent read FOnError write FOnError;
Published property OnStart: TNotifyEvent read FOnStart write FOnStart;
Published property OnStop: TNotifyEvent read FOnStop write FOnStop;

Description

Methods

Public constructor Create(AOwner: TComponent); override;

Creates an instance of TBrookHTTPServer.

Parameters
AOwner[in]
Owner component.
Public destructor Destroy; override;

Destroys an instance of TBrookHTTPServer.

Public procedure Open;

Starts the HTTP(S) server.

Public procedure Close;

Stops the HTTP(S) server.

Properties

Public property MHDHandle: Pointer read GetMHDHandle;

Contains the MHD instance.

Published property Active: Boolean read FActive write SetActive stored IsActiveStored;

Activates the HTTP(S) server.

Published property Authenticated: Boolean read FAuthenticated write SetAuthenticated stored IsAuthenticatedStored;

Enables/disables the basic HTTP authentication.

Published property HostName: string read FHostName write SetHostName stored IsHostNameStored;

Host name for listening to connections.

Published property Port: UInt16 read GetPort write SetPort stored IsPortStored default 0;

Port for listening to connections.

Published property Backlog: Word read FBacklog write SetBacklog stored IsBacklogStored default BROOK_BACKLOG;

Maximum length of the queue of pending connections. Default: 511.

Published property Threaded: Boolean read GetThreaded write SetThreaded stored IsThreadedStored default False;

Enables/disables the threaded model. If True, the server creates one thread per connection.

Published property UploadsDir: string read GetUploadsDir write SetUploadsDir stored IsUploadsDirStored;

Directory to store the uploaded files.

Published property PostBufferSize: NativeUInt read GetPostBufferSize write SetPostBufferSize stored IsPostBufferSizeStored default BROOK_POST_BUFFER_SIZE;

Post buffering size.

Published property PayloadLimit: NativeUInt read GetPayloadLimit write SetPayloadLimit stored IsPayloadLimitStored default BROOK_PAYLOAD_LIMIT;

Total payload limit. Use zero for no limit.

Published property UploadsLimit: UInt64 read GetUploadsLimit write SetUploadsLimit stored IsUploadsLimitStored default BROOK_UPLOADS_LIMIT;

Total uploads limit. Use zero for no limit.

Published property ThreadPoolSize: Cardinal read GetThreadPoolSize write SetThreadPoolSize stored IsThreadPoolSizeStored default 0;

Thread pool size. Size greater than 1 enables the thread pooling.

Published property ConnectionTimeout: Cardinal read GetConnectionTimeout write SetConnectionTimeout stored IsConnectionTimeoutStored default 0;

Inactivity time (in seconds) to a client get time out.

Published property ConnectionLimit: Cardinal read GetConnectionLimit write SetConnectionLimit stored IsConnectionLimitStored default 0;

Concurrent connections limit. Use zero for no limit.

Published property NoFavicon: Boolean read FNoFavicon write FNoFavicon stored IsNoFaviconStored default False;

Enables/disables the favicon handling. If True, it avoids 404 errors by sending an empty content (204) if path is '/favicon.ico'.

Published property Security: TBrookHTTPServerSecurity read FSecurity write SetSecurity;

Holds the TLS properties for the HTTPS server.

Published property OnAuthenticate: TBrookHTTPAuthenticateEvent read FOnAuthenticate write FOnAuthenticate;

Event triggered when a client requests authentication.

Published property OnAuthenticateError: TBrookHTTPAuthenticateErrorEvent read FOnAuthenticateError write FOnAuthenticateError;

Event triggered when a client authentication raises errors.

Published property OnRequest: TBrookHTTPRequestEvent read FOnRequest write FOnRequest;

Event triggered when a client requests a content.

Published property OnRequestError: TBrookHTTPRequestErrorEvent read FOnRequestError write FOnRequestError;

Event triggered when a client request raises errors.

Published property OnClientConnection: TBrookHTTPServerClientConnectionEvent read FOnClientConnection write FOnClientConnection;

Event triggered when a client connects to or disconnects from the server.

Published property OnError: TBrookErrorEvent read FOnError write FOnError;

Event triggered when the HTTP server raises errors.

Published property OnStart: TNotifyEvent read FOnStart write FOnStart;

Event triggered when the HTTP server starts successfully.

Published property OnStop: TNotifyEvent read FOnStop write FOnStop;

Event triggered when the HTTP server stops successfully.


Generated by PasDoc 0.16.0.