Page 1 of 1

How to get client IP address in OnClientError Event?

Posted: Wed 26 Sep 2018 13:46
by tcaduto12068
Hi,
I am using Lazarus and itn the OnclientError Event I have this:

Code: Select all

 if ClientInfo <> nil then
         begin
              ip:=inet_ntoa(clientinfo.SockAddr^.sin_addr);
              port:=intTostr(ntohs(ClientInfo.SockAddr^.sin_port));  

The client IP always comes back as 0.0.0.0

I get the port but not the IP.

The info in the log shows up like this:

SSH Client(0.0.0.0:59654) ERROR for user:N/A:Authentication failed

Re: How to get client IP address in OnClientError Event?

Posted: Wed 26 Sep 2018 14:21
by ViktorV
The similar question has already been discussed on our forum. Follow the link viewtopic.php?f=27&t=36424 for details.
The TScSSHServer.BeforeClientConnect event is added in 8.2.4 from 24-Apr-18
If any specific questions remain or come up after reading the article, please contact us - we will answer you.