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
Hi Aravindan. I haven't personally done much work with manual path selection, but RTT Prober does. I'd suggest looking at it as an example...
https://bitbucket.org/ra_/tor-rtt/src/3a2ef9343d3054b8bcf37877d81d926400ed85...
relay_ip_addresses = ["10.0.0.21","10.0.0.22","10.0.0.23"]
circuit_id = controller.extend_circuit('0',relay_ip_addresses)
The circuit path should be relay fingerprints, not IP addresses...
https://stem.torproject.org/api/control.html#stem.control.Controller.extend_...
Cheers! -Damian
On Saturday 16 November 2013 20:02:26 Damian Johnson wrote:
Hi Aravindan. I haven't personally done much work with manual path selection, but RTT Prober does. I'd suggest looking at it as an example...
https://bitbucket.org/ra_/tor-rtt/src/3a2ef9343d3054b8bcf37877d81d926400ed8 512/rttprober.py?at=master#cl-447
If you are interested in path selection only, an early but single-threaded version might be more suitable: https://bitbucket.org/ra_/tor- rtt/src/2d65c3d6744372295916b9e48d779215c3253eb4/RTTprobe.py
This is slightly related to ticket 8728[0].
Best, Robert