Find open port for MITM server / doesn't start a new server for every request
For every HTTPS request, a new MITM server is started. This is because the certificate needs to set the host (see vcr_proxy.rb:32) for every request, because they could be different. And because of that, for every request a free port is needed.
How could this be improved? First it's slow, and second when more and more requests are made, the port numbers could run out.
You should generate a CA certificate for your proxy server which a person can then add to the list of trusted certs on their system, e.g. OS X users can add it to their Keychain and set to trust all the time for SSL.
A la http://www.charlesproxy.com/documentation/using-charles/ssl-certificates/
thx, I'll have a look at this. sorry for the late response!