Exemple #1
0
bool static ApplyProxySettings() {
    QSettings settings;
    CService addrProxy(settings.value("addrProxy", "127.0.0.1:9050").toString().toStdString());
    int nSocksVersion(settings.value("nSocksVersion", 5).toInt());

    if (!settings.value("fUseProxy", false).toBool()) {
        addrProxy = CService();
        nSocksVersion = 0;
        return false;
    }

    if (nSocksVersion && !addrProxy.IsValid()) {
        return false;
    }

    if (!IsLimited(NET_IPV4)) {
        SetProxy(NET_IPV4, addrProxy, nSocksVersion);
    }

    if (nSocksVersion > 4) {
#ifdef USE_IPV6

        if (!IsLimited(NET_IPV6)) {
            SetProxy(NET_IPV6, addrProxy, nSocksVersion);
        }

#endif
        SetNameProxy(addrProxy, nSocksVersion);
    }

    return true;
}
Exemple #2
0
bool static ApplyProxySettings()
{
    QSettings settings;
    CService addrProxy(settings.value("addrProxy", "127.0.0.1:9050").toString().toStdString());
    if (!settings.value("fUseProxy", false).toBool()) {
        addrProxy = CService();
        return false;
    }
    if (!addrProxy.IsValid())
        return false;
    if (!IsLimited(NET_IPV4))
        SetProxy(NET_IPV4, addrProxy);
    if (!IsLimited(NET_IPV6))
        SetProxy(NET_IPV6, addrProxy);
    SetNameProxy(addrProxy);
    return true;
}