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

qtwebsocket

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Incomplete
    • Affects Version/s: 5.9.2
    • Fix Version/s: None
    • Component/s: WebSockets
    • Labels:
      None
    • Environment:
      windows7,应该是所有windos吧
    • Platform/s:
      Windows

      Description

      客户端连接服务器时,使用wireshark抓包结果分析如下

       

      实际抓包如下
      GET / HTTP/1.1
      Host: tanglei9.eicp.top:80
      Connection: Upgrade
      Pragma: no-cache
      Cache-Control: no-cache
      Upgrade: websocket
      Origin: http://127.0.0.1
      Sec-WebSocket-Version: 13
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
      Accept-Encoding: gzip, deflate
      Accept-Language: zh-CN,zh;q=0.9
      Sec-WebSocket-Key: wHcuR2mZD/4+oq8v6K3ZGg==
      Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

      期望包结构如下
      GET / HTTP/1.1
      Host: tanglei9.eicp.top
      Connection: Upgrade
      Pragma: no-cache
      Cache-Control: no-cache
      Upgrade: websocket
      Origin: http://127.0.0.1
      Sec-WebSocket-Version: 13
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
      Accept-Encoding: gzip, deflate
      Accept-Language: zh-CN,zh;q=0.9
      Sec-WebSocket-Key: wHcuR2mZD/4+oq8v6K3ZGg==
      Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

      使用pwebsocket->open(Qurl("ws://tanglei9.eicp.top"));连接时
      Host: tanglei9.eicp.top:80 请改为 Host: tanglei9.eicp.top
      因为我们做有的项目使用前面带":80"的无法连接上服务器,但是除了80端口其他端口没有问题,虽然理论上都因该可以的

       

       

        Attachments

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

          Activity

            People

            Assignee:
            kurt.pattyn Kurt Pattyn
            Reporter:
            tanglei 雷 唐
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes