FHTTP:=TIdHTTPServer.Create(
nil);
if FRooms.HTTPSettngs.OnlySSL
then
begin
FHTTP.IOHandler:=FIdServerIOHandlerSSLOpenSLL;
end;
FHTTP.AutoStartSession:=True;
FHTTP.SessionState:=True;
FHTTP.ParseParams:=True;
FHTTP.Bindings.Clear;
FHTTP.SessionTimeOut:=300;
FHTTP.SessionIDCookieName:='
MyTextCookie';
for i:=0
to FRooms.HTTPSettngs.IPs.Count-1
do
begin
if (FRooms.HTTPSettngs.Port>0)
and (
not FRooms.HTTPSettngs.OnlySSL)
then
begin
with FHTTP.Bindings.Add
do
begin
IP:=FRooms.HTTPSettngs.IPs[i];
Port:=FRooms.HTTPSettngs.Port;
ListenParams:=ListenParams+
IP+'
:'+IntToStr(Port)+'
';
end;
end else
if (FRooms.HTTPSettngs.SSLPort>0)
and (FRooms.HTTPSettngs.OnlySSL)
then
begin
with FHTTP.Bindings.Add
do
begin
IP:=FRooms.HTTPSettngs.IPs[i];
Port:=FRooms.HTTPSettngs.SSLPort;
ListenParams:=ListenParams+
IP+'
:'+IntToStr(Port)+'
';
end;
end else begin
with FHTTP.Bindings.Add
do
begin
IP:=FRooms.HTTPSettngs.IPs[i];
Port:=80;
ListenParams:=ListenParams+
IP+'
:'+IntToStr(Port)+'
';
end;
end;
end;
FHTTP.OnCommandGet:=OnCommandGet;
FHTTP.OnCommandOther:=OnCommandOther;