From 011edfe2a07169a8c475c9c90b5f27bb9d6c7965 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 4 Nov 2018 14:13:56 -0800 Subject: [PATCH] Disable any usage of proxy servers --- app/backend/nvhttp.cpp | 5 +++++ app/main.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/app/backend/nvhttp.cpp b/app/backend/nvhttp.cpp index 4d89a921..3cb713ea 100644 --- a/app/backend/nvhttp.cpp +++ b/app/backend/nvhttp.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #define REQUEST_TIMEOUT_MS 5000 @@ -24,6 +25,10 @@ NvHTTP::NvHTTP(QString address) : m_BaseUrlHttps.setHost(address); m_BaseUrlHttp.setPort(47989); m_BaseUrlHttps.setPort(47984); + + // Never use a proxy server + QNetworkProxy noProxy(QNetworkProxy::NoProxy); + m_Nam.setProxy(noProxy); } QVector diff --git a/app/main.cpp b/app/main.cpp index 5680b1d1..6196e2be 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -5,6 +5,7 @@ #include #include #include +#include // Don't let SDL hook our main function, since Qt is already // doing the same thing. This needs to be before any headers @@ -288,6 +289,13 @@ int main(int argc, char *argv[]) } #endif + // We don't want system proxies to apply to us + QNetworkProxyFactory::setUseSystemConfiguration(false); + + // Clear any default application proxy + QNetworkProxy noProxy(QNetworkProxy::NoProxy); + QNetworkProxy::setApplicationProxy(noProxy); + // Register custom metatypes for use in signals qRegisterMetaType("NvApp");