1

Possible Duplicate:
Tor with Python?

conn = TorCtl.connect(controlAddr="127.0.0.1", controlPort=9051)

While running this command on Python console it is not displaying any error but I'm unable to connect with Tor.

Community
  • 1
  • 1
yogkm
  • 649
  • 5
  • 15
  • Did you do `import TorCtl` or `from TorCtl import TorCtl`? Surprisingly, this actually makes a difference -- TorCtl seems to prefer `from TorCtl import TorCtl'. – solvingPuzzles Mar 15 '13 at 01:59

1 Answers1

0

TorCtl.connect is only going to connect to the Tor process (making it controllable from Python), but it won't do anything beyond that (like creating routes). To do that, you'll need to read the howto.

nneonneo
  • 171,345
  • 36
  • 312
  • 383
  • 1
    `import socket` `import TorCtl` `s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)` `s.connect(("127.0.0.1", 9100))` `conn = TorCtl.get_connection(s)` **in this code the last line is displaying following error.** `AttributeError: 'module' object has no attribute 'get_connection' ` – yogkm Oct 05 '12 at 12:31
  • I'm having the same problem with the `AttributeError ... has no attribute 'get_connection'`. `TorCtl` and `socket` are installed. – solvingPuzzles Mar 15 '13 at 01:56
  • https://svn.torproject.org/svn/torctl/branches/stable/python/TorExample.py – zazabe Nov 05 '13 at 04:20