tor控制在哪里?

时间:2017-06-08 06:02:14

标签: c++ qt tor

根据this tutorial,我可以通过Tor by Vidalia启动我的网络连接,如图所示

network settings

但是当我下载最新的tor(windows版本,6.5.2)时,我再也找不到Vidalia了,现在tor是从浏览器开始并以浏览器结束。我怎样才能进行与最近显示的图表相同的设置?

我尝试通过Qt5.6.2连接,但它总是失败(不建议像这样使用QNetworkAccessManager)

    //9150, 9151 both fails
    QNetworkProxy proxy(QNetworkProxy::DefaultProxy, "127.0.0.1", 9150);
    QNetworkProxy::setApplicationProxy(proxy);
    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    //setup the proxy on network manager do not work either
    //manager->setProxy(proxy);
    connect(manager, static_cast<void(QNetworkAccessManager::*)(QNetworkReply*)>(&QNetworkAccessManager::finished),
            [=](QNetworkReply *reply)
    {
        qDebug()<<"push reply";
        QFile file("tor_reply.html");
        QTextStream stream(&file);
        if(file.open(QIODevice::WriteOnly)){
            stream<<reply->readAll();
        }
    });
    connect(manager, static_cast<void(QNetworkAccessManager::*)(QNetworkReply*)>(&QNetworkAccessManager::finished),
            manager, &QNetworkAccessManager::deleteLater);
    manager->get(QNetworkRequest(QUrl("http://www.whatsmyip.org/")));

我确认torrc启动并运行并且不更改torrc的任何设置,有什么建议吗?

1 个答案:

答案 0 :(得分:1)

我刚刚找到答案,更改代理设置有效:

QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, "127.0.0.1", 9150);

如何设置?

  1. 转到工具
  2. 点击选项
  3. 点击高级
  4. 点击网络
  5. 点击设置(请参阅下面的图3~5)
  6. graph_0

    1. 调整手动代理配置。我使用默认选项:
    2. enter image description here