Doken13, here's sample code to retrieve either a real client IP
or a proxy's IP...and determine which is which :
// HTTP_VIA is not null if there's a proxy between your server and the client
if(Context.Request.ServerVariables["HTTP_VIA"]!=null)
{
// So, this code returns the client's real IP
ip=Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else
{
// not using proxy or can't get the Client IP
//doesn't get the Client IP, but returns proxy IP
ip=Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
}
As George says, you can not always get the Client IP through a proxy because
either a proxy will not send the client IP to you or a client can also be prevented
from sending its IP by the use of "header_access deny".
--
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
======================================
"George Ter-Saakov" <gt****@cardone.comwrote in message news:uw**************@TK2MSFTNGP05.phx.gbl...
Some proxies report in a request's header the actual client IP address.
There are 2 or 3 standard headers. x-forwarded-for is one of them
But some proxies do not do it. Those proxies called anonymous proxies by the way.
George.
"Doken13" <as*****@hotmail.comwrote in message news:ud**************@TK2MSFTNGP04.phx.gbl...
>>I got an intranet web site and there is a proxy on the network.
I want to retreive a client's IP, how could I get it ?