proxies+QML
-
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.
-
@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!