Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Setting application wide proxy settings
Forum Update on Monday, May 27th 2025

Setting application wide proxy settings

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qu0ll
    wrote on 23 Jul 2013, 21:15 last edited by
    #1

    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:

    @#include <QtGui/QGuiApplication>
    #include "qtquick2applicationviewer.h"
    #include <QNetworkProxy>

    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&#40;QStringLiteral("qml/Maps/main.qml"&#41;);
    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?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clogwog
      wrote on 25 Jul 2013, 12:27 last edited by
      #2

      just a question: is your

      bq. url.of.proxy.not.requiring.authentication

      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 ?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Serenity
        wrote on 25 Jul 2013, 14:47 last edited by
        #3

        Can you explain me, why Google Maps needs OpenSSL?
        I use Google maps in a WebView and it works without OpenSSL.

        1 Reply Last reply
        0

        1/3

        23 Jul 2013, 21:15

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved