QWebEngineView ignores QNetworkProxy with auth (Qt 6.8.1)
-
Hi, community 👋
I have an issue with paid proxy (with auth) and QWebEngineView.
I set up proxy by QNetworkProxy like
QNetworkProxy proxy; proxy.setType(QNetworkProxy::HttpProxy); proxy.setHostName("152.217.59.93"); proxy.setPort(5889); proxy.setUser("proxy_username"); proxy.setPassword("proxy_password"); QNetworkProxy::setApplicationProxy(proxy);
To check the proxy I send requests to https://freeipapi.com/api/json/
When I send HTTP GET request with QNetworkAccessManager then everything is fine and I get the proxy IP. So the proxy is correctly setup by QNetworkProxy::setApplicationProxy and working.
But when I open https://freeipapi.com/api/json/ with QWebEngineView then I get my IP and not the proxy IP. So something went wrong.
I have read https://doc.qt.io/qt-6/qtwebengine-overview.html#proxy-support
and I have connect to QWebEnginePage signalproxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost)
where I just set QAuthenticator settings to my proxy vars.
authenticator.setUser("proxy_username"); authenticator.setPassword("proxy_password");
but this signal is never emitted.
Aslo I have tried to create new QWebEnginePage after QNetworkProxy::setApplicationProxy.
I thought maybe the page would pull up the proxy settings when initializing. But this also not working.Has anyone encountered this? How to solve this issue?