Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Help regarding QNetworkProxy

    General and Desktop
    1
    1
    811
    Loading More Posts
    • 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.
    • K
      Ketan Shah last edited by

      Hi,

      I am working on an application that make use of QNetworkProxy.
      My problem is whenever I call QNetworkProxy::setApplicationProxy(proxy); my application hangs for sometime and then again becomes active. If I am using "Socks5Proxy" then it hangs for a long time and if I use "HttpProxy" then it hangs for a short time.
      What could be the problem, where I may be wrong? I am calling the proxyload() function from my main class constructor,
      Below is my code,

      @
      client::client(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::client)
      {
      ui->setupUi(this);
      proxyload();
      }
      void client::proxyload()
      {
      proxy.setType(QNetworkProxy::Socks5Proxy);
      proxy.setHostName("192.168.1.57");
      proxy.setPort(1080);
      //proxy.setUser("abc");
      //proxy.setPassword("123");
      QNetworkProxy::setApplicationProxy(proxy);
      }@

      1 Reply Last reply Reply Quote 0
      • First post
        Last post