QNetworkProxy
-
Hello
I just don't know what I do wrong, when I tried to use QNetworkProxy
I have a QTcpSockets
And I have a QNetworkProxy
Sometimes (when settings was changed) I do this
@m_networkProxy.setType(QNetworkProxy::HttpProxy);
m_networkProxy.setHostName(proxyAddress);
m_networkProxy.setPort(proxyPort);
if (proxyAuthEnabled)
{
m_networkProxy.setUser(proxyUser);
m_networkProxy.setPassword(proxyPassword);
}
else
{
m_networkProxy.setUser("");
m_networkProxy.setPassword("");
}
QNetworkProxy::setApplicationProxy(m_networkProxy);@
But for proxy with authorization - authorization doesn't work ( -
Then, as I wrote, QNetworkProxy::HttpProxy is probably the wrong type of proxy for you. You can use it, but the proxy you connect to must support the CONNECT protocol.
If the connect fails, what is the output of the sockets "error() ":http://doc.qt.nokia.com/4.7/qabstractsocket.html#error method?
-
I'm making a simple proxy (very simple, without auth., etc), which connect browser and remote server.
I have QTcpServer. When new connection came - create a QTcpSocket to remote host (from parsed header).
And I need to add support of external proxy (browser - my_proxy - external_proxy - remote_server)
Till I work with external proxies, without auth. - the QNetworkProxy(HttpProtocol mode) works fine, but when the auth requestes it just doesn't work.
I thank I need to make proxy support manually... )= -
If the connect fails, what is the output of the sockets error() [doc.qt.nokia.com] method?
QAbstractSocket::ProxyConnectionClosedError
"Proxy connection closed prematurely"