'QWebEngineView SOCKS5 proxy with authorization

Is there any way to make QWebEngineView work with SOCKS5 with authorization?

I tried connecting QWebEnginePage::proxyAuthenticationRequired signal to my slot, but it was never emitted. https://wiki.qt.io/QtWebEngine/Network says that username and password are ignored, but when I use http proxy, QWebEngineView works without ever triggering proxyAuthenticationRequired.

I also tried using "Proxy-Authorization" header, but it also had any effect only with http proxy.

    auto proxy = QNetworkProxy::applicationProxy();
    QWebEngineView *view = new QWebEngineView();
    QWebEngineHttpRequest request(QUrl("http://google.com"));
    QByteArray path = (proxy.user() + ":" + proxy.password()).toUtf8().toBase64();
    request.setHeader("Proxy-Authorization", "Basic " + path);
    view->load(request);
    view->show();


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source