O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a proxy

If you want to use a proxy, you first have to set up QNetworkProxy. You can define the type of proxy with setType(). As arguments, you will most likely want to pass QNetworkProxy::Socks5Proxy or QNetworkProxy::HttpProxy. Then, set up the hostname with setHostName(), the username with setUserName(), and the password with setPassword(). The last two properties are, of course, only needed if the proxy requires authentication. Once the proxy is set up, you can set it to the access manager via QNetworkAccessManager::setProxy(). Now, all new requests will use this proxy.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required