title: Using Windows 10 netsh portproxy to forward to multiple services
body: <p>I'm working on a project where we have several applications on the same VM, running on Pow. In testing, I might hit the first at <code>ourdomain.dev</code>, and content on that page that also makes requests to <code>ourdomain2.dev</code>. They are served on different ports- let's say <code>192.168.10.10:3000</code> and <code>192.168.10.10:8888</code> respectively.</p>
  
  <p>I can set up a proxy using netsh to the applications with the following commands:</p>
  
  <pre><code>netsh.exe interface portproxy add v4tov4 listenaddress=ourdomain.dev listenport=80 connectaddress=192.168.10.10 connectport=3000
  netsh.exe interface portproxy add v4tov4 listenaddress=ourdomain2.dev listenport=80 connectaddress=192.168.10.10 connectport=8888
  </code></pre>
  
  <p>... however, only the most recently added entry takes precedence- I'm guessing because they both need to listen on port 80?</p>
  
  <p>If I add <em>only one</em> of the above, everything will work for that specific service. However, if I add more than one as above, requests going to <code>ourdomain.dev</code> would also be sent to <code>ourdomain2.dev</code>.</p>
  
  <p>It's possible to accomplish the routing I need by modifying the Win10 hosts file, however I would prefer to directly reference the application VM's IP and port rather than the host machine to make the solution more portable (the VM's IP is static in our environment).</p>