Fix to proxy settings

Added back SOCKS5 proxy support for HTTP communications
This commit is contained in:
Christophe Dumez 2010-01-07 20:35:12 +00:00
parent 6ae49acb69
commit 296acf820c
4 changed files with 58 additions and 24 deletions

View file

@ -35,6 +35,8 @@
#include <QNetworkRequest>
#include <QNetworkProxy>
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5};
/** Download Thread **/
downloadThread::downloadThread(QObject* parent) : QObject(parent) {
@ -105,7 +107,7 @@ void downloadThread::applyProxySettings() {
qDebug("Using proxy: %s", (IP+QString(":")+port).toLocal8Bit().data());
proxy.setPort(port.toUShort());
// Default proxy type is HTTP, we must change if it is SOCKS5
if(intValue%2==0) {
if(intValue == SOCKS5 || intValue == SOCKS5_PW) {
qDebug("Proxy is SOCKS5, not HTTP");
proxy.setType(QNetworkProxy::Socks5Proxy);
} else {