Client IP Address lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- nugax · 2018-03-04 22:01 How can I simply get a client ip and/or dns hostname ---------------------------------------------------------------------- BlueIcaro · 2018-03-04 22:10 Hi, I used  Indy components. With  TidIPWatch component you can write Code: [Select]MiIp := IdIPWatch1.CurrentIP; /BlueIcaro ---------------------------------------------------------------------- nugax · 2018-03-05 14:16 Indy components? I am not familiar. Can you elaborate on how/where I can use these? ---------------------------------------------------------------------- Leledumbo · 2018-03-06 09:58 What do you use at server side? Plain socket? Some library? ---------------------------------------------------------------------- BlueIcaro · 2018-03-08 06:48 Quote from: nugax on March 05, 2018, 03:16:04 pmIndy components? I am not familiar. Can you elaborate on how/where I can use these? Install the package. Use it. Like any other  component in Lazarus http://wiki.freepascal.org/Indy_with_Lazarus#How_to_install /BlueIcaro ---------------------------------------------------------------------- Remy Lebeau · 2018-03-12 21:48 Quote from: BlueIcaro on March 08, 2018, 07:48:46 amInstall the package. Use it. Like any other  component in Lazarus http://wiki.freepascal.org/Indy_with_Lazarus#How_to_install Note that Indy is in Lazarus' OPM, so you don't need to install it manually per those instructions anymore. ---------------------------------------------------------------------- tudi_x · 2018-03-13 09:14 IP without Indy: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses Process function GetIpAddrList(): string;var  AProcess: TProcess;  s: string;  sl: TStringList;  i, n: integer; begin  Result:='';  sl:=TStringList.Create();  {$IFDEF WINDOWS}  AProcess:=TProcess.Create(nil);  AProcess.CommandLine := 'ipconfig.exe';  AProcess.Options := AProcess.Options + [poUsePipes, poNoConsole];  try    AProcess.Execute();    Sleep(500); // poWaitOnExit not working as expected    sl.LoadFromStream(AProcess.Output);  finally    AProcess.Free();  end;  for i:=0 to sl.Count-1 do  begin    if (Pos('IPv4', sl[i])=0) and (Pos('IP-', sl[i])=0) and (Pos('IP Address', sl[i])=0) then Continue;    s:=sl[i];    s:=Trim(Copy(s, Pos(':', s)+1, 999));    if Pos(':', s)>0 then Continue; // IPv6    Result:=Result+s+'  ';  end;  {$ENDIF}  {$IFDEF UNIX}  AProcess:=TProcess.Create(nil);  AProcess.CommandLine := '/sbin/ifconfig';  AProcess.Options := AProcess.Options + [poUsePipes, poWaitOnExit];  try    AProcess.Execute();    //Sleep(500); // poWaitOnExit not working as expected    sl.LoadFromStream(AProcess.Output);  finally    AProcess.Free();  end;   for i:=0 to sl.Count-1 do  begin    n:=Pos('inet addr:', sl[i]);    if n=0 then Continue;    s:=sl[i];    s:=Copy(s, n+Length('inet addr:'), 999);    Result:=Result+Trim(Copy(s, 1, Pos(' ', s)))+'  ';  end;  {$ENDIF}  sl.Free();end;