Important: Please read the Qt Code of Conduct -


  • I want to use qnetworkproxyfactory to direct networkflow to use proxy server for external http/s calls and not to use it for internal http/s calls. The project I am working on is a Q Quick project, which mostly built upon qml and javascript, so I am wondering where I should add the networkproxyfactory piece. Shall I create a subclass of qnetworkproxyfactory and use it in main.cpp (this is the way I am trying) or actually I have to modify and recompile network module (which I am trying to avoid) - because I am unsure of how to use qnetworkproxyfactory to track the http/https calls which are actually set in qml. Currently I just hard code the URLs. What suggestion do you have? Thanks.

  • Lifetime Qt Champion

    @AtoZ You should not post such questions in "C++ Gurus" forum, as it is unrelated to C++ programming language.

  • Lifetime Qt Champion

    @jsulm Moved to QML&Quick :)

  • @aha_1980 @aha_1980 Thanks fro taking care of that! However, the reason I posted the question here is that I thought I would have to subclass QtNetworkProxyFactory c++ code and use its queryProxy function to filter out the URLs - to tell whether they are internal or external, then decide to use Proxy to not. SystemConfig is really a good thing to take advantage of, but our requirement is for our application to work on all kinds of mobile devices - Windows, iOS and Android, so preferably we can handle Proxy server without using SystemConfig. I have subclassed the QtNetworkProxyFactory , and overloaded its queryProxy function, but I am not sure where and how to use the subclass and its queryProxy function in main.cpp. Thanks!

  • @AtoZ you may want to take a log at this blog post as it may help...

Log in to reply