[tor-dev] Using Stem to monitor TBB usage.

remi py remipy at yandex.com
Sat Oct 26 14:57:28 UTC 2013


I am having trouble using Stem to connect to the tor controller, while at the same time browsing the web using the TBB. 
The tor control settings can be edited in Vidalia -> settings -> advanced. There it is configured by default to use port 9150 and a random password for authentication, but I can not see what password. If I change any of these settings, then I cannot browse anymore, and TB displays "The proxy server is refusing connections".

I am using this snippet:

	import stem
	from stem.control import Controller

	with Controller.from_port(port = 9151) as controller:
	  controller.authenticate('')  # provide the password here if you set one

	  bytes_read = controller.get_info("traffic/read")
	  bytes_written = controller.get_info("traffic/written")

	  print "My Tor relay has read %s bytes and written %s." % (bytes_read, bytes_written)

from https://stem.torproject.org/tutorials/the_little_relay_that_could.html

So my problem is that I can not connect to the tor controller while at the same time browsing using the tbb. How do I fix this?

Kind regards,

More information about the tor-dev mailing list