anchor.diff:  interface
   
   Uses Output, APIBase, IdBaseComponent, IdComponent, IdTCPServer, IdHTTPServer, StdCtrls,
  -    ExtCtrls, HTTPApp, Windows, NovusConsoleUtils, SysUtils;
  +    ExtCtrls, HTTPApp, Windows, NovusConsoleUtils, SysUtils, IdCustomHTTPServer, IdContext,
  +    Classes, NovusFileUtils, IdServerIOHandler, IdSSL, IdSSLOpenSSL, NovusStringUtils;
   
   Type
     TPlugin_WebServerEngine = class(Tobject)
     protected
     private
  +    fServerIOHandlerSSLOpenSSL: TIdServerIOHandlerSSLOpenSSL;
  +    fHTTPServer: TIdHTTPServer;
       foOutput: TOutput;
  -    function CurrentConsoleMode( handle: THandle ): Cardinal;
  +
  +    procedure ServerIOHandlerSSLOpenSSLGetPassword(var Password: string);
  +    procedure HTTPServerCommandGet(AContext: TIdContext;
  +      ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
  +    function GetOutputPath: String;
  +    function GetDefaultDocument: string;
  +    function GetUseSSL: boolean;
  +    function GetSSLPassword: string;
  +    function GetPort: integer;
  +    function GetSSLPath: String;
     public
       constructor Create(aOutput: tOutput);
       destructor Destroy; override;
   
       function Execute: Boolean;
  -  end;
  +
  +    property DefaultDocument: String
  +      read GetDefaultDocument;
  +
  +    property OutputPath: String
  +      read GetOutputPath;
  +
  +    property UseSSL: boolean
  +       read GetUseSSL;
  +
  +    property SSLPassword: string
  +      read GetSSLPassword;
  +
  +    property Port: Integer
  +      read GetPort;
  +
  +    property SSLPath: string
  +      read GetSSLPath;
  + end;
   
   implementation
   
  
positive.code: constructor tPlugin_WebServerEngine.Create(aOutput: tOutput);
  begin
    foOutput := aOutput;
  end;
  
  destructor  tPlugin_WebServerEngine.Destroy;
  begin
  end;
  
  function tPlugin_WebServerEngine.CurrentConsoleMode( handle: THandle ): Cardinal;
  Begin
    Win32Check( GetConsoleMode( handle, Result ));
  End;
  
  function ConProc(CtrlType : DWord) : Bool; stdcall; far;
  var
  
negative.code:   ch: char;
  begin
    Try
      FHTTPServer.DefaultPort := Port;
  
      if UseSSL then
        begin
          FHTTPServer.IOHandler := fServerIOHandlerSSLOpenSSL;
  
          fServerIOHandlerSSLOpenSSL.SSLOptions.KeyFile:= SSLPath +  'sample.key';
          fServerIOHandlerSSLOpenSSL.SSLOptions.CertFile:= SSLPath + 'sample.crt';
          fServerIOHandlerSSLOpenSSL.SSLOptions.RootCertFile:= SSLPath  + 'sampleRoot.pem';
        end;
  
  
  
      foOutput.Log('WebServer address: ' + IntToStr(FHTTPServer.DefaultPort));
  
      FHTTPServer.Active := true;
  
      foOutput.Log('WebServer running ... press ctrl-c to stop.');
  
      stdin := TNovusConsoleUtils.GetStdInputHandle;
  