OzanYukruk
OzanYukruk

Reputation: 205

QNetworkProxy - Bypass Certain Addresses

In my QT5 application (Windows environment), I'm setting application-wide proxy using:

        QNetworkProxy proxy;
        proxy.setType(QNetworkProxy::HttpProxy);
        proxy.setHostName(proxyHost);
        proxy.setPort(proxyPortInt);

My client has an exception list for their proxy. However when I set my proxy as above, that exception list is not being used as expected.

In Internet Options you can specify an exception list as: Proxy Exception List

So my questions are:

  1. Is it possible for me to get that exception list?
  2. Can I somehow register this exception list to QNetworkProxy?

EDIT: I've noticed that I can get that exception list from registry:

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ ProxyOverride

Upvotes: 0

Views: 702

Answers (1)

Michael Schm.
Michael Schm.

Reputation: 2534

No. QNetworkProxy has no exception list. If you use an application wide proxy the best thing you can do is to disable the proxy for certain sockets by calling serverSocket->setProxy(QNetworkProxy::NoProxy), but you can't disable it for certain hostnames. You will have to check before the connection is estabilished if a proxy should be used and then either disable or set it.

Upvotes: 1

Related Questions