使Tor ControlPort正常工作 [英] Getting Tor ControlPort to work

查看:249
本文介绍了使Tor ControlPort正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装Tor在Windows机器上作为服务运行,并且我试图通过Stem包在python中发出请求.在我的torrc文件中,我已将ControlPort指定为9051并设置了HashedControlPassword.当我运行netstat时,我看到Tor正在localhost:9050上运行,但是没有监听端口9051.因此,当我尝试在python中连接到ControlPort时:

I have installed Tor to run as a service on my windows machine and I am trying to make requests in python through the Stem package. In my torrc file I have specified ControlPort as 9051 and set a HashedControlPassword. When I run netstat, I see that Tor is running on localhost:9050 but there is nothing listening to port 9051. As a result, when I try to connect to the ControlPort in python:

Controller.from_port(port=9051)

导致

[Errno 10061] No connection could be made because the target machine actively refused it

我尝试重新启动该服务,甚至重新安装了Tor浏览器,但是似乎没有任何东西可以使ControlPort正常工作.

I've tried restarting the service, I even reinstalled Tor Browser but nothing seems to make the ControlPort work.

推荐答案

您遇到的问题是因为您正在将Tor作为Windows服务运行. 问题是,当tor作为服务安装时,无论出于何种原因都未启用控制端口. 要解决您的问题,请打开终端,导航到tor目录,然后键入以下命令:

the problem you have is because you are running tor as a Windows Service. The issue is that when tor is installed as a service, for whatever reason the Control Port is not enabled. To fix your issue, open your terminal, navigate to the tor directory and type the following commands:

tor --service remove
tor --service install -options ControlPort 9051

现在,tor已作为服务安装,并且在端口9051上启用了ControlPort. 如果您键入"netstat -an",您现在将看到端口9051已打开.

Now, tor is installed as a service AND the ControlPort is enabled on port 9051. If you type "netstat -an" you will now see that port 9051 is open.

然后您将能够使用Stem连接到ControlPort.

You will then be able to use Stem to connect to the ControlPort.

我希望这会有所帮助.

和平. 星期六阿南达.

Peace. Sat Cit Ananda.

这篇关于使Tor ControlPort正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆