Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Setting application wide proxy settings
Qu0ll last edited by
I have posted previously about my efforts to get Google Maps to display in WebView. I discovered that I needed to install OpenSSL so that HTTPS could be used for some of the Google APIs.
That's all well and good but now on a different machine I am having touble configuring Qt to use the system proxy. For this one we have one system proxy that does not require authentication and one that does. The default proxy is the one that does require authentication.
I have the following code to specify the proxy:
int main(int argc, char *argv)
QGuiApplication app(argc, argv);
QNetworkProxy proxy; proxy.setType(QNetworkProxy::HttpProxy); proxy.setHostName("url.of.proxy.not.requiring.authentication"); proxy.setPort(8080); QNetworkProxy::setApplicationProxy(proxy); QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/Maps/main.qml")); viewer.showExpanded(); return app.exec();
When I run this application I get a web page displayed in WebView whose contents state there is an error 407 because the proxy requires authentication and the proxy address specified in this page is the default one and not the one I am explicitly telling Qt to use.
How can I get Qt to use the actual proxy I want it to use? All other apps on this machine can use it so why not Qt?
clogwog last edited by
just a question: is your
an auto config uri like a http://myproxy.server/proxy.pac ?
a server name ?
or an ip address ?
and if it is a server name, can you try the ip address instead ?
Serenity last edited by
Can you explain me, why Google Maps needs OpenSSL?
I use Google maps in a WebView and it works without OpenSSL.