-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect web proxy environment settings #105
Comments
IMHO that's Qt's job. But actually, it looks like qtbase/src/network/kernel/qnetworkproxy_generic.cpp already queries these env vars. This just needs to be enabled. Can you test if adding |
I changed main like this: diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp
index 306a269..6524296 100644
--- a/kdwsdl2cpp/src/main.cpp
+++ b/kdwsdl2cpp/src/main.cpp
@@ -26,6 +26,7 @@
#include <QTimer>
#include <QCoreApplication>
#include <QDebug>
+#include <QNetworkProxyFactory>
static const char *WSDL2CPP_DESCRIPTION = "KDAB's WSDL to C++ compiler";
static const char *WSDL2CPP_VERSION_STR = "2.0";
@@ -146,6 +147,8 @@ int main(int argc, char **argv)
Settings::self()->setNameSpace(nameSpace);
Settings::self()->setOptionalElementType(optionalElementType);
KWSDL::Compiler compiler;
+
+ QNetworkProxyFactory::setUseSystemConfiguration(true);
// so that we have an event loop, for downloads
QTimer::singleShot(0, &compiler, SLOT(run())); I rerun both kdwsdl2cpp for .h and .cpp, recompiled, but it did not work eventhough the environment is set: $ env |grep prox
https_proxy=http://proxy:8080
http_proxy=http://proxy:8080
no_proxy=10.0.0.0/8,127.0.0.1,172.16.0.0/12,192.168.20.0/24 Isn't setUseSystemConfiguration(true) the default anyway? |
Hi, I still need to set the proxy manually and the environment settings are ignored: m_service.clientInterface()->setProxy(proxy); |
Hi, in applications using QNetworkAccessManager it's possible to do m_networkAccessManager.proxyFactory()->setUseSystemConfiguration(true); In KDSOAP I only found QNetworkProxy KDSoapClientInterface::proxy () Is there any way to get access to the QNetworkProxyFactory ? |
Just like https://sourceforge.net/p/gsoap2/bugs/1115/, KDSoap could respect the http_proxy https_proxy and no_proxy environment settings in order to make the user configure the proxy later. Currently this can only be done outside of KDSoap by setting the QNetworkProxy. This was mentioned in #99.
However for the kdwsdl compiler this issue becomes more inconvenient, when it tries to download included xsd code:
However this could be worked around using some wrapper like tsocks.
The text was updated successfully, but these errors were encountered: