Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Debugging Proxy Not Found error - trying to set a transparent FTP proxy
Chambece last edited by
First post and was hoping that someone might be able to assist.
I am trying to set up proxy support for our application, which uses FTP, using Qt 4.7.3, and am having difficulty with the various options and settings. I am using Windows 7, and have a test machine that requires a proxy to be used, and the proxy server is using Squid. Unfortunately, I do not have access to the configuration of the proxy server.
I am using QNetworkProxyFactory::systemProxyForQuery to get the proxy, and this seems to be returning the correct settings as defined for FTP in Internet Settings.
On a machine where no proxy is required, I can successfully get my file through an FTP connection.
On the test machine, my QNetworkRequest fails with a QNetworkReply::ProxyNotFoundError. Pinging the proxy server from the command line works with no problems, and I am able to access the net through a browser which also requires the proxy.
I don't really know how best to proceed - I am getting an error which I don't really understand the cause of, and was wondering if I could find out any more information with from the system.
I have tried accessing the FTP site using CoreFTP, and this works when accessing the site through an FTP connection, with the same proxy host/port set, with the settings set as a Transparent FTP Proxy, but I don't know how to set such a configuration in Qt.
When I use QNetworkProxyFactory::systemProxyForQuery for my FTP request, I get a proxy with the following:
@Type : HttpProxy
Tunneling : true
Listening : false
UPD Tunneling : false
Caching : true
Host Lookup : true
isCaching : true
isTransparent : true@
I have also tried to set the type to be a Socks5Proxy as per the code example, and an FtpCachingProxy, but this also seemed to fail in the same way.
I will be perfectly honest and say I don't totally understand all of the different proxy options and capabilities, but would greatly appreciate if someone could assist me with this.
Chambece last edited by
I have been looking into this a little more, and I am now wondering if it is possible to do this :(
Looking at QNetworkAccessFtpBackend::open() , it seems that this will only work through NoProxy or an FtpCachingProxy
Also, I have looked into some of the proxy code, and in qnetworkproxy_win.cpp, in parseServerList, it looks like the only possible returns are HttpProxys, or Socks5Proxys
Am I right in thinking that this is essentially not supported on windows? :(