Proxy and QTcpSockets
-
Connect to the proxy instead of the actual host and do the correct protocol handshake etc.pp. There is nothing special regarding Qt in this area.
BTW: why do you implement your own HTTP protocol handler using QTcpSocket? There's QNetworkAccessManager with a fine HTTP implementation. Or use some of the other libs out there (eg. curl or neon).
-
For example from assistant:
@QNetworkProxy proxy;
proxy.setType(QNetworkProxy::Socks5Proxy);
proxy.setHostName("proxy.example.com");
proxy.setPort(1080);
proxy.setUser("username");
proxy.setPassword("password");socket->setProxy(proxy);
@or you can install proxy for all application connection:
@QNetworkProxy::setApplicationProxy(proxy);@
-
why do you implement your own HTTP protocol handler using QTcpSocket? There’s QNetworkAccessManager with a fine HTTP implementation. Or use some of the other libs out there (eg. curl or neon).
I develop a small proxy server... And I need to work directly with http headers...For example from assistant:
I did it like in this sample, but it doesn't work for example at youtube...