[Interest] Odd Proxy Behavior

Thiago Macieira thiago.macieira at intel.com
Wed Nov 30 05:39:23 CET 2016


On terça-feira, 29 de novembro de 2016 20:06:35 PST Jason Kretzer wrote:
> Thanks Thiago.
> ===
> Why this if? Why not always tell it to use the system configuration?
> ===
> 
> If there was a proxy detected should I not try to use it?  Or does the line
> below just automatically use whatever is set in "Internet Options"?
> QNetworkProxyFactory::setUseSystemConfiguration(true);

Your code is like this:
	if there are detected system proxies
		use the first (and ignore the rest)
	otherwise
		use detected system proxies

So, explain to me why your code always uses the system proxies, except that it 
forces the first one if there's one?

> ===
> Please try each of the following:
>  1) both HTTP and HTTPS URLs
>  2) turn off the Caching feature of the proxy and setApplicationProxy
>  3) use QTcpSocket to open a connection to somewhere, on both ports 80 and
> 443
 ===
> 
> 1) I tried both HTTP and HTTPS with the same results
> 2) I have no access to the proxy, unless this can somehow be turned off from
> code.

Sorry, I didn't explain properly.

I meant to take the QNetworkProxy that the detection code got, then remove the 
CachingCapability flag, then setApplicationProxy.

> 3) I have done this and both ports return false (see code below)
> bool ServerCommunication::connectToPort(QString server, int port)
> {
>     QTcpSocket socket;
>     socket.connectToHost(server,port);
>     if(socket.waitForConnected(500)) {
>         socket.close();
>         return true;
>     }
>     socket.close();
>     return false;
> }

This means the proxy rejected the CONNECT command.

To confirm: please obtain a packet capture from that machine while the 
connection is attempted.

If it were a Linux machine, I'd ask for an strace, but you said it's Windows.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list