program CustomSessionSample; {$APPTYPE CONSOLE} uses System.SysUtils, Winapi.Windows, Winapi.ShellAPI, Web.WebReq, Web.WebBroker, IdHTTPWebBrokerBridge, WebModuleUnit1 in 'WebModuleUnit1.pas' {WebModule1: TWebModule} , AppControllerU in 'AppControllerU.pas', MemoryWebSessionController in 'MemoryWebSessionController.pas'; {$R *.res} procedure RunServer(APort: Integer); var LServer: TIdHTTPWebBrokerBridge; begin Writeln(Format('Starting HTTP Server or port %d', [APort])); LServer := TIdHTTPWebBrokerBridge.Create(nil); try LServer.DefaultPort := APort; LServer.Active := True; ShellExecute(0, 'open', PChar('http://localhost:' + IntToStr(APort) + '/login/john'), nil, nil, SW_SHOW); Writeln('Press RETURN to Exit'); ReadLn; finally LServer.Free; end; end; begin ReportMemoryLeaksOnShutdown := True; try if WebRequestHandler <> nil then WebRequestHandler.WebModuleClass := WebModuleClass; WebRequestHandlerProc.MaxConnections := 1024; RunServer(8080); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.