[tor-dev] Fwd: Stem Tor - Establish a user defined circuit

Aravindan B aravindbros at gmail.com
Sat Nov 16 05:02:45 UTC 2013


Hi all,

Need some help in writing python script for establishing connection in stem
tor using the method

controller.new_circuit() or controller.extend_circuit()

I tried this

from stem import CircStatus
from stem.control import Controller

with Controller.from_port() as controller:
  controller.authenticate()

relay_ip_addresses = ["10.0.0.21","10.0.0.22","10.0.0.23"]

circuit_id = controller.extend_circuit('0',relay_ip_addresses)

But i am getting Socket already closed exception. Am i right with the
syntax of the same. The thing i am trying to achieve is that i want tor to
choose the following ip addresses for

1. 10.0.0.21 for entry
2. 10.0.0.22 for middle nodes
3. 10.0.0.23 for exit nodes

I need tor chose only these three ip nodes as the relay. I have to run this
inside CORE Emulator to simulate TOR in CORE. Expecting a reply soon.
Thanks in advance for the help.

Thanks and regards
Aravindan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20131115/11a05fb9/attachment.html>


More information about the tor-dev mailing list