我已經安裝了Tor作爲我的Windows機器上的服務運行,並且我試圖通過Stem包在python中發出請求。在我的torrc文件中,我將ControlPort指定爲9051並設置了一個HashedControlPassword。當我運行netstat,我看到的Tor是在本地主機上運行:9050,但沒有什麼監聽端口9051.結果是,當我嘗試連接到ControlPort在python:讓Tor ControlPort工作
Controller.from_port(port=9051)
導致
[Errno 10061] No connection could be made because the target machine actively refused it
我試過重新啓動服務,我甚至重新安裝了Tor瀏覽器,但似乎沒有任何東西讓ControlPort工作。
防火牆問題?當你得到它的工作,你可能想要使用'context_manager'形式:'與Controller.from_port(端口= 9051)作爲控制器:controller.authenticate(密碼=「」)' –
AChampion