From 7ca3ca2c20845d4bf03816817c849dd0d8b92b6a Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 24 Oct 2024 01:03:54 +0800 Subject: [PATCH] added a randomized proxy bypass --- client/core/controllers/apiController.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/core/controllers/apiController.cpp b/client/core/controllers/apiController.cpp index 1f8257ee3..4e907a103 100644 --- a/client/core/controllers/apiController.cpp +++ b/client/core/controllers/apiController.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "QBlockCipher.h" #include "QRsa.h" @@ -346,6 +347,7 @@ ErrorCode ApiController::getServicesList(QByteArray &responseBody) if (sslErrors.isEmpty() && shouldBypassProxy(reply, responseBody, false)) { m_proxyUrls = getProxyUrls(); + std::shuffle(m_proxyUrls.begin(), m_proxyUrls.end(), QRandomGenerator::global()->generate()); for (const QString &proxyUrl : m_proxyUrls) { qDebug() << "Go to the next endpoint"; request.setUrl(QString("%1v1/services").arg(proxyUrl));