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. Connection from Qwebview to Qwebsocketserver problem
QtWS25 Last Chance

Connection from Qwebview to Qwebsocketserver problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
websocketwebviewwebsocketserver
2 Posts 1 Posters 2.1k Views
  • 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.
  • T Offline
    T Offline
    TeunGri173
    wrote on 25 Dec 2015, 19:16 last edited by TeunGri173
    #1

    Hello,
    I have an application wherein i use a qwebsocketserver and qwebview. I load the web socket client html file from the web socket chat client example, in the qwebview instance. The result is that no new connection is received in the websocketserver.

    When i load the same ws client example html in firefox or chrome, new ws connections are received in the ws server.

    When i open the qwebview inspector console, an error about invalid utf-8 sequence is showing up

    I use qt 5.5.1

    Installed qt 5.6 beta, and used browser examples to load the ws html. Still no new connection rcvd in ws server.

    Can anybody give me a hint how to solve this problem.

    I inspected with wireshark what is being send by:

    QWebView:
    GET / HTTP/1.1
    Upgrade: websocket
    Connection: Upgrade
    Host: 192.168.10.119:13031
    Origin: file://
    Pragma: no-cache
    Cache-Control: no-cache
    Sec-WebSocket-Key: Ui7g46fJv4/VZTjwJMu7UA==
    Sec-WebSocket-Version: 13
    Sec-WebSocket-Extensions: x-webkit-deflate-frame
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) TestGui Safari/538.1

    FireFox:
    GET / HTTP/1.1
    Host: 192.168.10.119:13031
    User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:40.0) Gecko/20100101 Firefox/40.1.0 Waterfox/40.1.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    DNT: 1
    Sec-WebSocket-Version: 13
    Origin: null
    Sec-WebSocket-Extensions: permessage-deflate
    Sec-WebSocket-Key: 1FCDteKWdkgu0xvFGpU2Rg==
    Connection: keep-alive, Upgrade
    Pragma: no-cache
    Cache-Control: no-cache
    Upgrade: websocket

    The Firefox version could establish a websocket connection.
    Thanks in advance.

    T 1 Reply Last reply 27 Dec 2015, 23:31
    0
    • T TeunGri173
      25 Dec 2015, 19:16

      Hello,
      I have an application wherein i use a qwebsocketserver and qwebview. I load the web socket client html file from the web socket chat client example, in the qwebview instance. The result is that no new connection is received in the websocketserver.

      When i load the same ws client example html in firefox or chrome, new ws connections are received in the ws server.

      When i open the qwebview inspector console, an error about invalid utf-8 sequence is showing up

      I use qt 5.5.1

      Installed qt 5.6 beta, and used browser examples to load the ws html. Still no new connection rcvd in ws server.

      Can anybody give me a hint how to solve this problem.

      I inspected with wireshark what is being send by:

      QWebView:
      GET / HTTP/1.1
      Upgrade: websocket
      Connection: Upgrade
      Host: 192.168.10.119:13031
      Origin: file://
      Pragma: no-cache
      Cache-Control: no-cache
      Sec-WebSocket-Key: Ui7g46fJv4/VZTjwJMu7UA==
      Sec-WebSocket-Version: 13
      Sec-WebSocket-Extensions: x-webkit-deflate-frame
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) TestGui Safari/538.1

      FireFox:
      GET / HTTP/1.1
      Host: 192.168.10.119:13031
      User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:40.0) Gecko/20100101 Firefox/40.1.0 Waterfox/40.1.0
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
      Accept-Language: en-US,en;q=0.5
      Accept-Encoding: gzip, deflate
      DNT: 1
      Sec-WebSocket-Version: 13
      Origin: null
      Sec-WebSocket-Extensions: permessage-deflate
      Sec-WebSocket-Key: 1FCDteKWdkgu0xvFGpU2Rg==
      Connection: keep-alive, Upgrade
      Pragma: no-cache
      Cache-Control: no-cache
      Upgrade: websocket

      The Firefox version could establish a websocket connection.
      Thanks in advance.

      T Offline
      T Offline
      TeunGri173
      wrote on 27 Dec 2015, 23:31 last edited by TeunGri173
      #2

      @TeunGri173
      I did a test against http://www.websocket.org/echo.html with QWebView in my application. This test is working correctly.

      So there is someting with the QWebSocketServer I use.
      The only I do is:
      ws = new QWebSocketServer("", QWebSocketServer::NonSecureMode, this); ws->listen( QHostAddress::Any, 13031);
      And of course connect to the newConnection() signal.

      resume test results:

      Backend Frontend Result
      websocket.org QWebView OK
      websocket.org FireFox OK
      websocket.org Chrome OK
      QWebSocketServer QWebView FAIL
      QWebSocketServer FireFox OK
      QWebSocketServer Chrome OK

      Only the combination QWebSocketServer / QWebView failed.
      Any hints wat to configure in QWebSocketServer ?
      Or could it possibly be a bug ?

      Thanks in advance for your info.

      1 Reply Last reply
      0

      1/2

      25 Dec 2015, 19:16

      • Login

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