Search code examples
c#iishttpwebrequest

Which IP Address HttpWebRequest uses when run on IIS - server's or client's?


When you have a web page hosted on a IIS server which submits HttpWebRequests, does it use the IP address of the client's or the server's? Is there a way to get and view the IP from the HttpWebRequest class itself?


Solution

  • If it's running from server code (C#) then it will use the server's IP address (its public facing IP, not internal - if the destination server is public). If it's running via script in the browser, it will use the client's IP address.