[gelöst] QHttp und Proxy

Alles rund um die Programmierung mit Qt
Antworten
D.Cent
Beiträge: 44
Registriert: 25. Juli 2007 15:39

[gelöst] QHttp und Proxy

Beitrag von D.Cent »

Hallo, würde gerne mit QHttp eine Datei herunterladen. Nur scheint mit dem Proxy etwas nicht zu stimmen:

Code: Alles auswählen

#include <iostream>
using namespace std;

#include <QHttp>
#include <QApplication>
#include <QIODevice>
#include <QBuffer>
#include <QByteArray>
#include <QUrl>
#include <QEventLoop>

int main(int argc, char**argv)
{
    QApplication app(argc, argv);
    QBuffer buffer;
    QEventLoop loop;
    
    QHttp client;
    client.setProxy("proxy.irgendeine_url.com", 8080); //Proxy nicht öffentlicht, daher geändert
    client.setHost("www.faznet.de");
    
    QObject::connect(&client, SIGNAL(done(bool)), &loop, SLOT(quit())); 
    
    client.get("/s/Rub/Tpl~Epartner~SRss_.xml", &buffer);
    
    loop.exec();
    
    QByteArray bytes;
    bytes = buffer.buffer();

    cout << bytes.data() << endl; 
}
Als einzige Ausgabe (beim cout) kommt leider nur:

Code: Alles auswählen

sHost=faznet.de sUrl=/s/Rub/Tpl~Epartner~SRss_.xml
Was ist falsch?

Ich nutze Qt 4.5 auf Windows XP SP2, compiler ist Dev-CPP mit MinGW G++ 3.4.2
Zuletzt geändert von D.Cent am 10. August 2009 12:10, insgesamt 1-mal geändert.
D.Cent
Beiträge: 44
Registriert: 25. Juli 2007 15:39

Beitrag von D.Cent »

Ah, habs gefunden - tut mir leid. Das Problem war nur die Seite.
Antworten