How to find the end user's IP address in a cloud environment

We noticed today that one of our ASP.NET cloud applications incorrectly identified the end user's IP address. Our Request.ServerVariables["REMOTE_HOST"] and Request.ServerVariables["REMOTE_ADDR"] were initialized with the load balancer information instead of the end user's data.

We found the end user's IP in a different place: Request.Headers["X-Cluster-client-IP"].

Happy coding!

Welcome to ModelBlog

Thank you for visiting ModelBlog. We hope the time you spend with us will be both entertaining and worth your while. Have fun!

Authors

Search

Archive

Tags