title: How to create simple IIS site to redirect all calls to another service?
body: <p>I've written a REST API service in Delphi, which runs as its own stand-alone service. I also have IIS hosting some sites on port <code>80</code>. I would like to use port <code>80</code> for my REST API as well, but since I'm already using it in IIS, I'm forced to use another port.</p>
  
  <p>What I'd like to do to overcome this is create a very simple site in IIS (Preferably with ASP.NET/C#) which simply redirects all incoming HTTP requests to this other service running on a different port. This would allow me to take advantage of binding multiple sites under the same port in IIS. I don't want to perform a literal "redirect", but just replicate the request to the desired server, and respond back - as if user was connecting to original REST server. Only, without having to use a non-standard port. The URL on the client-side shouldn't change (as what you normally see with an HTTP Redirect). </p>
  
  <p>Essentially, if user makes such a request:</p>
  
  <pre><code>http://api.mydomain.com/SomeReq?some=query
  </code></pre>
  
  <p>It will turn around and make a corresponding request to the real server, and carry over the entire URI - just a different port number:</p>
  
  <pre><code>http://api.mydomain.com:8664/SomeReq?some=query
  </code></pre>
  
  <p>How can I accomplish this?</p>