#1 2012-03-22 15:38:49

Junior/RO
Member
Registered: 2011-05-13
Posts: 210

How to get the client's IP address?

Hi.

I need to know the client's IP address. Where to look for?

Thank you.

Offline

#2 2012-03-29 15:11:32

Junior/RO
Member
Registered: 2011-05-13
Posts: 210

Re: How to get the client's IP address?

Can't find this information in documentation. How can a mORMot http server know the client's IP address?

Last edited by Junior/RO (2012-03-29 15:11:48)

Offline

#3 2012-03-29 15:54:55

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Re: How to get the client's IP address?

I don't think this is possible.

Offline

#4 2012-03-29 16:15:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to get the client's IP address?

There is no standard way of doing this.
From the mORMot point of view, this is a RESTful architecture, which does not know anything about IP (or even HTTP). It can even be accessed locally via GDI messages or via in-process (in a dll).

For the HTTP communication, it will depend on the server implementation class.
There is no such information provided by now from the framework to the process event.
With the HTTP kernel server, you can use Req^.Address.pRemoteAddress^ in procedure THttpApiServer.Execute to retrieve the IP.

Offline

#5 2012-03-29 16:55:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: How to get the client's IP address?

OK - I've modified both server classes (both WinSock based and http.sys based).

In fact, a new header 'RemoteIP: 127.0.0.1' has been added to retrieve the remote IP address in HTTP headers on server side.

See http://synopse.info/fossil/info/a9643f8a7d

Offline

#6 2012-03-29 18:32:56

Junior/RO
Member
Registered: 2011-05-13
Posts: 210

Re: How to get the client's IP address?

Thank you. I will try...

Ops... server don't run anymore. Hmm... you updated the sqlite3 engine.

Solution: update sqlite3*.obj files. Now it works again!

Offline

Board footer

Powered by FluxBB