[Qt-interest] Host lookups not working with QNetworkProxy?

Thiago Macieira thiago.macieira at trolltech.com
Wed Apr 29 12:05:24 CEST 2009


Bastian Bense wrote:
>Hey guys,
>
>I'm using QNetworkProxy to provide SOCKS5 support in my application
>and Tor (www.torproject.org) to provide additional privacy.
>In order to use some features of Tor (hidden services), the requested
>host name has to be looked up by Tor's SOCKS service and not on the
>local machine's normal DNS.
>It seems that QNetworkProxy has a host lookup capability, so I assume
>that a QTcpSocket would pass the hostname to the SOCKS proxy instead
>of looking it up itself.
>
>However, for some reason QTcpSocket does look up the hostname itself
>before passing the resulting IP address to the SOCKS proxy. Is there a
>way to have the socket pass the lookup requests to the SOCKS proxy?

This works, but please check that you're doing the following:

 - using Qt 4.5, since this feature wasn't available before

 - you create your QNetworkProxy objects without calling setType. That is:
	QNetworkProxy proxy(QNetworkProxy::Socks5Proxy);
   otherwise, you have to call
	setCapabilities(QNetworkProxy::HostNameLookupCapabitlity)

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090429/da7e14bc/attachment.bin 


More information about the Qt-interest-old mailing list