QtWebEngine/Network: Difference between revisions
(Move up the category hierarchy, out of single-page category.) |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Developing Qt]] | [[Category:Developing Qt]] | ||
Qt WebEngine uses the Chromium networking stack instead | Qt WebEngine uses the Chromium networking stack instead of Qt Network. | ||
== Proxy Resolution == | == Proxy Resolution == | ||
Line 22: | Line 22: | ||
=== Proxy resolution in Qt WebEngine === | === Proxy resolution in Qt WebEngine === | ||
Qt WebEngine | Qt WebEngine does not feature an API for setting proxies directly. Anyhow, it can | ||
1. Use the system proxy settings | |||
2. Use any proxy set explicitly in Qt Network | |||
From Qt 5.8 onwards, The ''system proxy settings'' are used if QNetworkProxyFactory::useSystemConfiguration() returns true. Otherwise Qt WebEngine adapts QNetworkProxy::applicationProxy(). Other proxy settings in Qt Network are ignored. | |||
''Note:'' The code path used to auto-detect proxy settings in the network differ, depending on whether --single-process is used. See https://codereview.qt-project.org/#/c/115567/ for details. | ''Note:'' The code path used to auto-detect proxy settings in the network differ, depending on whether --single-process is used. See https://codereview.qt-project.org/#/c/115567/ for details. |
Revision as of 10:49, 21 July 2017
Qt WebEngine uses the Chromium networking stack instead of Qt Network.
Proxy Resolution
Note: If the first page takes long too load, this is often because Qt WebEngine queries the network for a PAC (Proxy Auto-Configuration) file.
Proxy resolution in Qt Network
Qt Network has a various levels to set proxies for client connections (evaluated in this order):
- QAbstractSocket::setProxy
- QNetworkAccessManager::setProxy
- QNetworkAccessManager::setProxyFactory
- QNetworkProxy::setApplicationProxy
- QNetworkProxyFactory::setUseSystemConfiguration
- QNetworkProxyFactory::setApplicationProxyFactory
Since Qt 5.6, there's a default QNetworkProxyFactory::applicationProxyFactory that uses the system settings (see -system-proxies / -no-system-proxies configure flag).
Proxy resolution in Qt WebEngine
Qt WebEngine does not feature an API for setting proxies directly. Anyhow, it can
1. Use the system proxy settings 2. Use any proxy set explicitly in Qt Network
From Qt 5.8 onwards, The system proxy settings are used if QNetworkProxyFactory::useSystemConfiguration() returns true. Otherwise Qt WebEngine adapts QNetworkProxy::applicationProxy(). Other proxy settings in Qt Network are ignored.
Note: The code path used to auto-detect proxy settings in the network differ, depending on whether --single-process is used. See https://codereview.qt-project.org/#/c/115567/ for details.
Proxy authentication
To authenticate proxies, connect to the QWebEnginePage::proxyAuthenticationRequired or WebEngineView::authenticationDialogRequested signal.
Links
http://doc.qt.io/qt-5/qtwebengine-overview.html#proxy-support