Link to home
Start Free TrialLog in
Avatar of Adriaan Boshoff
Adriaan Boshoff

asked on

Indy 10 web server not showing pages correctly

I'm trying to make a web server with TIdHTTPServer and so far it can display normal html pages. I want it to load this https://github.com/Facepunch/webrcon/tree/gh-pagesĀ site but It doesn't display it like it should be. A while back I made a web server with delphi 10 using the TcpServer component and that displays the site as it should be displayed but that component is no longer available in Rad Studio 10.2.2.

This is the following code for the command get event:
procedure Tfrmmain.idhtpsrvr1CommandGet(AContext: TIdContext;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
  with TStringList.Create do
    begin
      LoadFromFile('htdocs\index.html');
      AResponseInfo.ContentText := Text;
      Free;
    end;
end;

Open in new window


I never use indy so if anyone can help I would be great full.
Avatar of Geert G
Geert G
Flag of Belgium image

TcpServer has been moved to the samples since Delphi XE6
you can still install it and work with it

http://docwiki.embarcadero.com/RADStudio/XE6/en/What's_New_in_Delphi_and_C++Builder_XE6#Deleted
Avatar of Adriaan Boshoff
Adriaan Boshoff

ASKER

Yeah i have reinstalled it but why doesn't indy work that well? Someone told me i need to decode the get request or something like that
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.