How to get the IP of the incoming request ?

67 views
Skip to first unread message

ShacharWeis

unread,
Apr 16, 2012, 6:15:35 PM4/16/12
to Kayak HTTP
I want to log the IP of all calls to Kayak.
Thanks.

Benjamin van der Veen

unread,
Apr 16, 2012, 6:36:02 PM4/16/12
to kayak...@googlegroups.com

On Apr 16, 2012, at 15:15, ShacharWeis <shach...@gmail.com> wrote:

> I want to log the IP of all calls to Kayak.
> Thanks.

It will be the right-most value of the X-Forwarded-For header which Kayak adds for every incoming request.

pinehur...@gmail.com

unread,
Apr 23, 2012, 7:25:13 AM4/23/12
to kayak...@googlegroups.com
Hi,
 
I have the same question, I am using the RequestDelegate function, as a parameter to

KayakServer.Factory.CreateHttp(RequestDelegate, scheduler);

public void OnRequest(HttpRequestHead request, IDataProducer requestBody, IHttpResponseDelegate response)
I would have hoped the source IP would have been in the HttpRequestHead structure, but it does not seem to be
 
Can you please clarify
 
Thanks

Benjamin van der Veen

unread,
Apr 23, 2012, 10:09:14 PM4/23/12
to kayak...@googlegroups.com
It is in the X-Forwarded-For header. The format of the value of X-Forwarded-For is a comma delimited set of hosts. The host connecting to Kayak will always be the right-most value (i.e., each hop appends the IP of the client which initiated the connection). For more information see http://en.wikipedia.org/wiki/X-Forwarded-For
Reply all
Reply to author
Forward
0 new messages