PDA

View Full Version : Help with Qhttp and Proxy



Katuakina
10th May 2007, 12:13
Hello this is my first post and perhaps there is not enough information or something wrong. First Hi!!! to all of you!!!!

I am using QT HTTP example http://doc.trolltech.com/4.0/network-http.html (QT 4.2.2) for test because I need to make something similar in my project but I always received connection refuse when it start to transfer the file. Here are the degut output:
ERROR: httpRequestStarted!
ERROR: httpRequestFinished!
ERROR: httpRequestStarted!
The thread 'Win32 Thread' (0x1550) has exited with code 0 (0x0).
ERROR: httpRequestFinished!
ERROR Descriptor: Connection refused,

But if I add to the example
m_phttp->setProxy( "x.x.x.x", 8080); it works.
I get it from my PC from registry under HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet Settings but how I can know that this value is needed? And how I can get it from whatever user because I needed that my SW be used in different user PC with different settings in their PC?
Thanks a lot
Katukina

Katuakina
11th May 2007, 14:48
Please can someone help me?

wysota
11th May 2007, 15:25
You can use QSettings to look this value up in the registry.

Katuakina
14th May 2007, 09:46
Hello
Thanks for your reply but my question is When I need to look for that value in the registry? Always and if it has value uses SetProxy or when I have to uses Setproxy? Is not other way to know if proxy are needed?
Br katukina

wysota
14th May 2007, 10:50
The value you mention is a system value thus you have to query your system for it if you want to be aware of it. This means you have to use system calls to do that. In theory you could use QNetworkProxy but I never used that class and have no way of testing it in my environment as I don't use such proxies.

Katuakina
14th May 2007, 12:06
Ok I will try both of them. Uses system calls and to study the QNetworkProxy class.
Thanks Katya