title: Charles proxy to connect to localhost from SSL App
body: <p>Overview:</p>
  
  <ul>
  <li>I have a Android App that points to some remote https server</li>
  <li>I have a Rails app on localhost:3000</li>
  <li>I want to direct trafic from the app to my localhost</li>
  </ul>
  
  <p>Details:</p>
  
  <ol>
  <li>My machine IP is <code>192.168.0.16</code></li>
  <li>I have Charles Proxy setup on port <code>8888</code></li>
  <li>On the Android phone I have configured the Wifi connection to have a manual proxy to <code>192.168.0.16:8888</code></li>
  <li>On the Android phone I have installed the SSL root cert via <code>chls.pro/ssl</code>, added to <code>VPN and apps</code> (as per <a href="https://stackoverflow.com/a/33113392/119790">https://stackoverflow.com/a/33113392/119790</a>)</li>
  <li>Charles->Access Control Settings has my Android IP <code>192.168.0.15</code> listed</li>
  <li>Charles->SSL Proxying Settings has location: <code>*remoteserver.com:443</code></li>
  <li>Charles->Map Remote
  
  <ul>
  <li>from: <code>https</code>, <code>my.remoteserver.com</code>, <code>443</code></li>
  <li>to: <code>http</code>, <code>localhost</code>, <code>3000</code></li>
  </ul></li>
  <li>When I use the app Charles shows <code>Status: Connected to remote host</code>, and nothing more </li>
  <li><p>On my localhost I have a rails server</p>
  
  <pre><code>$ rails server
  ...
  Listening on localhost:3000, CTRL+C to stop
  </code></pre></li>
  <li>When I use the app nothing is ever logged (I can curl localhost and it logs that)</li>
  <li>If I stop the Rails server then Charles shows <code>Status: Failure</code>, <code>Response code: 503 Error</code></li>
  <li>So it connects, but fails to get a response?</li>
  </ol>
  
  <p>rails server running</p>
  
  <p><a href="https://i.stack.imgur.com/EJrMn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EJrMn.png" alt="rails server running"></a></p>
  
  <p>rails server not running</p>
  
  <p><a href="https://i.stack.imgur.com/VpIBw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VpIBw.png" alt="rails server not running"></a></p>
  
  <p>System: </p>
  
  <ul>
  <li>Android v7.1.2</li>
  <li>Charles v4.2.1</li>
  <li>OSX v10.13.3</li>
  </ul>