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

QWebSocket does not handle 302 redirect

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • WebSockets
    • None

    Description

      My application wants to use an external balancer for my websocket connections.

       

      It is expected to work in the following way:

      1. My application connects to some websocket address, thinking it is the final websocket server.
      2. Actually, this address is the address of a load balancer.
      3. Load balancer allows establishing SSL connection and reads HTTP request (that is always sent as part of websocket handshake inside encrypted connection)
      4. The balancer answers to this request with an HTTP 302 response, reporting `Location: ...` in HTTP response headers.
      5. QT Websocket receives this 302 response and (if configured to do so) reconnects to the address in the `Location:` header. Ideally with some interception in application (i.e., to change URL somehow. For example, change https:// to wss:// or to ensure that URL is wss:// and not ws://)

      Now it's impossible, since according to source code, QT Websocket client code does not handle 302 specifically.

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            socketpair@gmail.com Коренберг Марк
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes