title: How can I change my tor process' endpoint in stem?
body: <p>I'm using the <code>stem</code> to control a tor node created with <code>stem.process.launch_tor_with_config</code>.  I've also created a <code>stem.control.Controller</code> that is operating on the aforementioned process' control port.</p>
  
  <p>How can I change the exit node?  I looked at <code>stem.controller.Controller.new_circuit</code>, but this appears to change the <em>intermediate</em> nodes, preserving the endpoint.</p>
  
  <p>Does anybody know how this could be done?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>So I think I may be misunderstanding something fundamental, but I can't seem to wrap my head around it.  I tried calling <code>Controller.get_circuits()</code> and found a list of <code>CircuitEvent</code> objects.  Does this mean that a single process can handle multiple circuits?  If so, how do I select one for use?</p>
  
  <p>Note that I'm directing HTTP requests to through Privoxy, which in turn is forwarding it to the tor process' SOCKS port.</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>I found something that works, but I don't know <strong>how</strong> it works, which worries me.  I'll gladly award an answer to anyone who can either:</p>
  
  <ol>
  <li>Explain why my approach works</li>
  <li>Show be a better approach and explain how that works</li>
  </ol>
  
  <p>Here's what I've done:</p>
  
  <pre><code>for circuit in controller.get_circuits():
      controller.close_circuit(circuit.id)
  </code></pre>
  
  <p>There it is.  The external IP changed, so I know I've done <em>something</em> but hell if I know exactly what.</p>