Description
main.cpp
#include "mainwindow.h" #include <QApplication> #include <QtNetwork/QTcpServer> #include <QNetworkProxy> int main(int argc, char *argv[]) { QApplication a(argc, argv); qDebug()<< QNetworkProxy::applicationProxy(); //QNetworkProxy::setApplicationProxy(QNetworkProxy()); QTcpServer *server = new QTcpServer(); qDebug() << "RESULT " <<server->listen()<< " " << server->serverPort(); qDebug()<< server->errorString(); return 0; }
Outputs :
HttpProxy ""proxy.test.com":8080" ["Tunnel Caching NameLookup"]
RESULT false 0
"The proxy type is invalid for this operation"
If i uncomment the line:
QNetworkProxy::setApplicationProxy(QNetworkProxy());
It prints:
HttpProxy ""proxy.test.com":8080" ["Tunnel Caching NameLookup"]
RESULT true 0
""
Even having a configured proxy, i may want to listen at localhost or by other network that don't use the proxy.
If it is now required... it should be well documented in the QTcpServer... but i think it shouldn't be a problem to "listen" under a http proxy as you may ignore the proxy.
Attachments
Issue Links
- duplicates
-
QTBUG-58706 FortuneServer fails: "the proxy type is invalid for this operation"
- Closed