Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. [SOLVED] QWebView behaviour with JavaApplet through a SOCKS-Proxy
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QWebView behaviour with JavaApplet through a SOCKS-Proxy

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 1 Posters 1.7k 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.
  • S Offline
    S Offline
    sistux
    wrote on last edited by
    #1

    Hello everybody!

    There is a following problem:

    • I created a Qt-application with QWebView based on Qt 4.8.2

    • The application should load some java applet (please, don't ask me for what)

    • It functions well, but as long as not used a proxy

    • the proxy has no authorisation and was set with
      @QNetworkProxy proxy;
      proxy.setType(QNetworkProxy::Socks5Proxy);
      proxy.setHostName(myProxyAddress);
      proxy.setPort(myProxyPort);
      QNetworkProxy::setApplicationProxy(proxy);@

    • after this the QWebView instance will be created

    • with wireshark I can observe that the initial page request with applet tag goes through the proxy

    • after JVM starts all other load requests go direct and in the Java console the request have "proxy=DIRECT"

    • if the proxy is set in jcontrol it functions again, but it is not the way I wish

    What did I wrong and how it could be fixed?
    Do I need newest Qt-Version?

    Thank you for your advices.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sistux
      wrote on last edited by
      #2

      Hello everybody!

      The problem was solved after I spent a couple of day on it...
      I had a hope there are some "default" proxy factory or the proxy will be used installed by QNetworkProxy::setApplicationProxy(proxy) ... No way...

      Java will be considered as a plugin!!! That is why, the QWebView needs his own QNetworkProxyFactory implementation:

      • the queryProxy() should reimplemented, something like that

      @class SystemProxyFactory : public QNetworkProxyFactory
      {
      public:
      SystemProxyFactory();

      virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query)
      {
      QList<QNetworkProxy> ret;
      ret << QNetworkProxy::applicationProxy();
      return ret;
      }
      };
      ...
      QNetworkAccessManager* pNAM = m_pWebView->page()->networkAccessManager();
      pNAM->setProxyFactory(new SystemProxyFactory());
      @

      I hope somebody it helps...
      Good luck.

      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