title: How to get programmatically the Web browser's IP address and Port number in C#?
body: <p>I am creating a <strong>Http proxy</strong> that seats between the web browser and the web server and based on my requirements the proxy server should get the <strong>IP address</strong> and <strong>port number</strong> of the <strong>web browser</strong> that has made a request. Here is a class that represent the connection between the proxy and web browser.</p>
  
  <pre><code>  public class Client
    {
      public Client(IPAddress browserIP, int browserPort)
      {
         /*Use browserIP and browserPort to create a socket object*/
      }
    }
  </code></pre>
  
  <p>Note that i am not using  neither <strong>HttListener</strong> nor <strong>HttpRequest</strong> objects! I have created a custom <strong>Request</strong> object that allows me to set the http headers and other stuff that the HttpRequest object doesn't do;but my Request object doesn't have a method to get the browser IP address and Port.</p>