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. Problem with network proxy
Qt 6.11 is out! See what's new in the release blog

Problem with network proxy

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.4k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    adnan
    wrote on last edited by
    #1

    I am behind a http/https proxy. So to download a file using QNetworkAccessManager, i do the the following:
    @if(no_proxy)
    {
    QNetworkProxyFactory::setUseSystemConfiguration (false);
    QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
    }
    else if(system_proxy)
    {
    QNetworkProxyFactory::setUseSystemConfiguration (true);
    }
    else if(manual_proxy)
    {
    QNetworkProxyFactory::setUseSystemConfiguration (false);
    proxy.setHostName(address);
    proxy.setPort(port);
    if(http_proxy)
    proxy.setType(QNetworkProxy::HttpProxy);
    else if(socks_proxy)
    proxy.setType(QNetworkProxy::Socks5Proxy);
    else if(ftp_proxy)
    proxy.setType(QNetworkProxy::FtpCachingProxy);
    QNetworkProxy::setApplicationProxy(proxy);
    }@

    Now behind http squid proxy server, this code works fine in case of http urls. But, if i try to download a file with ftp url the download fails with the error
    @no suitable proxy found@
    It does not seem to use http proxy for ftp urls. But, we have such options like in firefox:
    @use this proxy server for all protocols@
    How to do similar thing in Qt!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      adnan
      wrote on last edited by
      #2

      Is their any solution to this problem or is it that it can't be done using Qt?

      1 Reply Last reply
      0

      • Login

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