Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-60298

QTcpServer fails to listen when system has a http proxy configured

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • 5.9
    • 5.8.0
    • Network
    • None
    • Windows 7

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tpochep Timur Pocheptsov
              bnogal Benjamín Nogal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes