If you are using the (really good) fpc http client and server, this will help -
Firstly, you need to override the function that gets called when a request is made, eg -
TMistyHTTPServer = Class(TFPHTTPServer)
...
procedure HandleRequest(Var ARequest: TFPHTTPConnectionRequest;
Var AResponse : TFPHTTPConnectionResponse); override;
Then implement that function
procedure TMistyHTTPServer.HandleRequest(var ARequest: TFPHTTPConnectionRequest;
var AResponse: TFPHTTPConnectionResponse);
...
IP := ARequest.RemoteAddress;
Both ARequest and AResponse have lots of info in there, sadly not documented but look in the source ....
Remember IP addresses are reassignable, one machine may have a particular IP today but sure does not mean its the same tomorrow.
Are you connecting as a web service where you have control of the client ? Better to send a unique code rather than relying on IP.
Davo