Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkProxy
Forum Updated to NodeBB v4.3 + New Features

QNetworkProxy

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DmT021
    wrote on last edited by
    #1

    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 (

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      If you work with QTcpSockets, you will probably have to use a SOCKS5 proxy.

      An HTTP proxy is only for use with QNetworkAccessManager, as it is a protocol proxy.

      Are you really sure, you work with QTcpSocket?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DmT021
        wrote on last edited by
        #3

        Of course I'm sure. I transfering valid http trafic over QTcpSocket.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          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?

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DmT021
            wrote on last edited by
            #5

            But, when I'll use the Socks5 - not all proxy servers supports Socks5

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              So it is.

              You provide us nearly no information about what you're doing and expect a solution?

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DmT021
                wrote on last edited by
                #7

                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... )=

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DmT021
                  wrote on last edited by
                  #8

                  If the connect fails, what is the output of the sockets error() [doc.qt.nokia.com] method?
                  QAbstractSocket::ProxyConnectionClosedError
                  "Proxy connection closed prematurely"

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved