anchor.diff:    ch: char;
   begin
     Try
  -    FHTTPServer.DefaultPort := Port;
  -
  -    if UseSSL then
  +    foOutput.Log('Starting WebServer ...');
  +
  +    if not TNovusIndyUtils.IsTCPPortUsed(Port, Server) 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;
  -
  -    SetConsoleCtrlHandler(@ConProc, True);
  -
  -    FCtrlflag := -1;
  -    start := GetTickCount;
  -    Repeat
  -      If TNovusConsoleUtils.IsAvailableKey( stdin ) Then
  -        begin
  -          if FCtrlflag = CTRL_C_EVENT then break;
  -
  -        end
  -      Else
  -        Sleep( 20 );
  -    Until false;
  +        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: ' + address);
  +
  +        FHTTPServer.Active := true;
  +
  +        foOutput.Log('WebServer running ... press ctrl-c to stop.');
  +
  +        stdin := TNovusConsoleUtils.GetStdInputHandle;
  +
  +        SetConsoleCtrlHandler(@ConProc, True);
  +
  +        FCtrlflag := -1;
  +        start := GetTickCount;
  +        Repeat
  +          If TNovusConsoleUtils.IsAvailableKey( stdin ) Then
  +            begin
  +              if FCtrlflag = CTRL_C_EVENT then break;
  +
  +            end
  +          Else
  +            Sleep( 20 );
  +        Until false;
  +      end
  +    else
  +      foOutput.Log('tcp port not open ... '+ Server + ':' + IntToStr(Port) + ' cannot start Webserver.');
     Except
  -
  +    foOutput.InternalError;
  +
  +    foOutput.Log('Cannot start Webserver.');
     End;
   end;
   
  
positive.code: 
      property SSLPath: string
        read GetSSLPath;
   end;
  
  implementation
  
negative.code:   result := TNovusFileUtils.TrailingBackSlash(TNovusStringUtils.RootDirectory) + 'SSL\'
  end;
  
  function tPlugin_WebServerEngine.GetAddress: String;
  begin
    if UseSSL then result := 'https://'
    else
      result := 'http://';
  
    result := result + Server + ':' +  IntToStr(Port);
  end;
  
  function tPlugin_WebServerEngine.GetServer: string;
  begin
    Result := '127.0.0.1';
  end;
  
  end.
  