Topic Path: Symbol Reference > Classes > TIdCustomHTTPServer Class
ContentsIndexHome
PreviousUpNext
TIdCustomHTTPServer Class

Specifies properties, methods, and events for the base HTTP Server implementation in Indy.

File
TIdCustomHTTPServer = class(TIdCustomTCPServer);

TIdCustomHTTPServer is a TIdTCPServer descendant that specifies properties, methods, and events for an implementation of the Hypertext Transfer Protocol (HTTP) as described in the Internet Standards document: 

RFC 1945 - Hypertext Transfer Protocol [HTTP] version 1.0  

RFC 2616 - Hypertext Transfer Protocol [HTTP] version 1.1  

TIdCustomHTTPServer also supports the Secure Hypertext Transport protocol (HTTPS) as described in the Internet Standards document: 

RFC 2660 - The Secure HyperText Transfer Protocol  

Assign an instance of TIdServerInterceptOpenSSL to the Intercept property to allow use of the HTTPS protocol. For the Windows platform, you must install the Indy OpenSSL support .DLL's available at the Intelicom website to enable Secure Socket Layer support. 

Application do not normally create instances of TIdCustomHTTPServer. Most properties, methods, and events in TIdCustomHTTPServer are protected to allow descendant classes to override their implementation. Use TIdHTTPServer to access published properties, method, and events. 

TIdCustomHTTPServer implements an overridden protected method that defines the behavior during execution of threaded client connections. The method (DoExecute) performs processing required to read and process an HTTP request from the client connection, as well as prepare and send an HTTP response. 

DoExecute reads the raw HTTP command, HTTP header values including Cookies, and any optional content stream from the client connection. HTTP request data is parsed into an TIdHTTPRequestInfo class instance used during execution of the client thread. 

DoExecute handles retrieving or creating persistent Sessions for threaded client connections. This is done using the IP for the client connection and the IDSESSIONID Cookie value included in the HTTP request. 

DoExecute constructs an HTTP response for the client request using an TIdHTTPResponseInfo instance. It initializes server and Session properties in the response, and relies on the OnCommandGet or OnCommandOther event handlers to complete the content of the HTTP response. The HTTP response, and any optional content stream, are written to the client connection. 

DoExecute will close the client connection prior to exiting when KeepAlive is not supported on the server, or if the client omits the HTTP "Keep-Alive" header in the HTTP request. 

During execution of a threaded client connection, the following

Exceptions 
Description 
Malformed command in the HTTP request. 
Invalid or unsupported authorization scheme in the HTTP request. 
Raised when a connection is closed by the peer prior to writing the HTTP response. All Other Exceptions should be handled and included in the HTTP response using the HTTP response number and response message as defined in the HTTP protocol. 
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.