diff options
| -rw-r--r-- | README | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -40,3 +40,33 @@ For more extensive examples of the PathSupport and StatsSupport interfaces, see the TorFlow project at git url: git clone git://git.torproject.org/git/torflow.git + +Example usage of TorCtl: + +You must start tor with the control port enabled. This can +be done by adding this line to your torrc: + +ControlPort 9051 + +It is recommended to enable password or cookie authentication +to access the Tor Control port. +To generate the hashed password run the command: + +$ tor --hash-password yourpassword | tail -n 1 +16:28C70C32C9EFC94A6014F477E653A2B2F19E31CE8495E4AE2F0538E0D3 + +You should then add this line to your torrc + +HashedControlPassword 16:28C70C32C9EFC94A6014F477E653A2B2F19E31CE8495E4AE2F0538E0D3 + +At this point you are able to interface with the Tor Control port with +something like this: + +from TorCtl import TorCtl +conn = TorCtl.connect(passphrase="yourpassword") +conn.get_info("version")["version"] + +outputs: + +'0.2.3.10-alpha-dev (git-ea0b922b391de6ef)' + |
