title: Does HTTP CONNECT tunnel need to closed before connecting again?
body: <p>I am currently trying to set up an HTTP tunnel using <a href="https://tinyproxy.github.io/" rel="nofollow noreferrer">Tinyproxy</a>. This is the structure of my system:</p>
  
  <p>Source -> Proxy -> Destination</p>
  
  <p>I have successfully opened a socket to my proxy, sent the HTTP <code>CONNECT</code> request, and established a tunnel to my destination. Data sends properly back and forth, and then the proxy socket is closed. The system automatically tries to connect again once it needs to, and this time I can't issue an HTTP <code>CONNECT</code> command (Although every ~10 minutes something resets, because I am able to connect again).</p>
  
  <p>Do I need to send some kind of reset command to the proxy to disconnect the HTTP tunnel? Is closing the socket connection to my proxy not enough? Wireshark analysis shows some kind of RST (reset) flag might be messing up the connection from the source to the proxy.</p>
  
  <p>Edit: I believe the socket is closing gracefully. I dug into the send() function, and I am getting back <code>errno = 11, "Try Again"</code>. Which isn't a very helpful error message.</p>