ASP.NET How can I get client IP after load balancer

G

Guest

I am attempting to get access to the client IP after a request has gone
through a load balancer.

HttpContext.Current.Request.UserHostAddress is what I am using and getting
what appears to be the load balancers IP.

Any ideas on how I could get around this?

Thanks.
 
C

Chris Priede

kapsolas said:
I am attempting to get access to the client IP after a request has
gone through a load balancer.
HttpContext.Current.Request.UserHostAddress is what I am using and
getting what appears to be the load balancers IP.

There is no real standard for this, but load balancers usually pass the real
client IP through as a custom header (e.g. "X-Client-IP"). Dump your
Request.Headers collection and see what it is called in your case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top