0

I've created a HTTP server via the IdHTTP-component and now I want to access it via the internet. I've posted a string from a text file.

I can accesss it via:

http://localhost

But how do I acces it via the internet? I've tried http://[myexternalIPaddress]:80 but I do not get a reply.

This is my code:

procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  myFile : TextFile;
  text: String;
begin
  AssignFile(myFile, 'C:\Users\xxx\Desktop\test.txt');
  Reset(myFile);
  ReadLn(myFile, text);  
  AResponseInfo.ContentText := text;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  IdHTTPServer1.Active := True;
end;
Petermch
  • 191
  • 15

1 Answers1

1

You need to configure your Windows Firewall (if enabled) to allow inbound connections to port 80, and you also need to configure your network router (if you have one) to forward inbound connections to port 80 on your router's public IP to port 80 on your server machine.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Brank Victoria
  • 1,447
  • 10
  • 17