title: Running Fiddler as a Reverse Proxy for HTTPS server
body: <p>I have the following situation: 2 hosts, one is a client and the other an HTTPS server.</p>
  <pre><code>Client (:&lt;brwsr-port&gt;) &lt;=============&gt; Web server (:443)
  </code></pre>
  <p>I installed <a href="http://www.telerik.com/fiddler" rel="noreferrer">Fiddler</a> on the server so that I now have Fiddler running on my server on port 8888.</p>
  <p>The situation i would like to reach is the following:</p>
  <pre><code>|Client (:&lt;brwsr-port&gt;)| &lt;===&gt; |Fiddler (:8888) &lt;===&gt; Web server (:443)|
  |-Me-------------------|       |-Server--------------------------------|
  </code></pre>
  <p>From my computer I want to contact Fiddler which will redirect traffic to the web server. The web server however uses HTTPS.</p>
  <p>On The server I set up Fiddler to handle HTTPS sessions and decrypt them. I was asked to install on the server Fiddler's fake CA's certificate and I did it! I also inserted the script suggested by the Fiddler wiki page to redirect HTTPS traffic</p>
  <pre><code>// HTTPS redirect ----------------------- 
  FiddlerObject.log(&quot;Connect received...&quot;);
  if (oSession.HTTPMethodIs(&quot;CONNECT&quot;) &amp;&amp; (oSession.PathAndQuery == &quot;&lt;server-addr&gt;:8888&quot;)) {
      oSession.PathAndQuery = &quot;&lt;server-addr&gt;:443&quot;;
  }
  // --------------------------------------
  </code></pre>
  <p>However when I try <code>https://myserver:8888/index.html</code> I fail!</p>
  <h2>Failure details</h2>
  <p>When using Fiddler on the client, I can see that the CONNECT request starts but the session fails because response is HTTP error 502. Looks like no one is listening on port 8888. In fact, If I stop Fiddler on the server I get the same situation: 502 bad gateway.</p>
  <p>Please note that when I try <code>https://myserver/index.html</code> and <code>https://myserver:443/index.html</code> everything works!</p>
  <h2>Question</h2>
  <p>What am I doing wrong?</p>
  <h2>Is it possible that...?</h2>
  <p>I thought that since maybe TLS/SSL works on port 443, I should have Fiddler listen there and move my web server to another port, like 444 (I should probably set on IIS an https binding on port 444 then). Is it correct?</p>