我已经安装了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