program HelloWorldWebServerX3; //{$APPTYPE CONSOLE minimal -extend auto IP Hoster} //#sign: max: MAXBOX8: 15/01/2017 15:17:48 //uses SysUtils, IdContext, IdCustomHTTPServer, IdHTTPServer; procedure HTTPServerCommandGet(AContext: TIdPeerThread; ARequestInfo: TIdHTTPRequestInfo; ARespInfo: TIdHTTPResponseInfo); begin ARespInfo.ResponseNo:= 200; ARespInfo.ContentType:= 'text/plain'; ARespInfo.ContentText:= 'Hi IBZ TimeServe at: ' +DateTimeToInternetStr(Now,true); end; begin //@main //TWebServerCreate; with TIdHTTPServer.Create(Nil) do begin sr:= GetIPfromHost(getHostName) //'172.16.10.80'; Bindings.Add.IP:= sr; Bindings.Add.Port:= 8080; OnCommandGet:= @HTTPServerCommandGet; Active:= True; try Writeln('Hello world/Web server start at: '+sr); ShowMessageBig('maXbox Hello WorldWeb server at: '+sr+#1310+ ' Press OK to quit webserver!'+#13); finally writeln('SocketServer stop: '+timetoStr(now)); //TWebServerDestroy; Active:= False; Free; end; end; End. ref: https://rosettacode.org/wiki/Hello_world/Web_server#Delphi add bindings & contenttype for more convention Doc: Function DateTimeToInternetStr( const Value : TDateTime; const AIsGMT : Boolean) : String Function GetIPAddress( const HostName : string) : string Function GetIP( const HostName : string) : string Function GetIPHostByName(const AComputerName: String): String; function GetIPFromHost(const HostName: string): string; HTTPServer1.Bindings.Add.IP := '127.0.0.1'; HTTPServer1.Bindings.Add.Port := 50001; writeln(GetIPAddress(getHostName)); writeln(GetIP(getHostName)); writeln(GetIPHostByName(gethostname)); writeln(GetIPfromhost(gethostname)); This is a common newbie mistake. You are creating two bindings, one bound to 127.0.0.1:DefaultPort, and one bound to 0.0.0.0:50001. You need one binding instead, that is bound to 127.0.0.1:50001 instead. with HTTPServer1.Bindings.Add do begin IP := '127.0.0.1'; Port := 50001; end; call example: procedure TDataFormbtnHTTPSendGetClick(Sender: TObject); var HTTPClient : TIdHTTP; responseStream : TMemoryStream; begin HTTPClient := TIdHTTP.Create(Nil); responseStream := TMemoryStream.Create; try try HTTPClient.Get1('http://127.0.0.1:8080', responseStream); responseStream.Seek(0, soFromBeginning); SetLength(Sr, responseStream.Size); responseStream.Read(Sr, responseStream.Size); writeln('response: '+sr) //writeln(': '+streamtoString3(responseStream)) except //on e : Exception do begin showmessage('Could not send get request to localhost, port 8080'); end; //end; finally //FreeAndNil(HTTPClient); HTTPClient.Free; HTTPClient:= Nil; responseStream.Free; end; end; ----code_cleared_checked_clean----