我想在tor的website上使用python的幹函數庫來控制Ubuntu的linux。然而,當我跑了建議Python代碼如何通過Python上的Python +幹得到Tor中繼信息?
from stem.control import Controller
with Controller.from_port(port = 9051) 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)
我得到的錯誤:
Traceback (most recent call last):
File "littleRelay.py", line 5, in module
bytes_read = controller.get_info("traffic/read")
File "/usr/local/lib/python2.7/dist-packages/stem/control.py", line 852, in get_info
raise exc
stem.InvalidArguments: GETINFO request contained unrecognized keywords: traffic/read
那麼,如何可以通過Python得到Tor中繼信息+幹在Linux上? 我覺得Tor正在運行,很好,因爲我從終端開始Tor和它說
[notice] Tor has successfully opened a circuit. Looks like client functionality is working.
[notice] Bootstrapped 100%: Done.
而且,當我運行上面的Python代碼,終端說
[notice] New control connection opened.
附:我也試過在Windows PC上的代碼,它的工作。我現在很困惑。
那沒有工作,但由於安德烈在Ubuntu上安裝Tor的做。 – user3478516