Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML, Node js and websocket
Qt 6.11 is out! See what's new in the release blog

QML, Node js and websocket

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 2.9k 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
    the-smaug
    wrote on last edited by
    #1

    Hi,

    Actually having trouble with websocket in Qml.
    What i want : a nodejs server with a qml client

    My node js server seems to work, because when i instanciate a Websocket in Chrome console it works

    Here is my client

     WebSocket {
                id: secureWebSocket
                url: "ws://localhost:3000"
                onTextMessageReceived: {
                    console.log("\nReceived secure message: ")
                }
                onStatusChanged: if (secureWebSocket.status == WebSocket.Error) {
                                     console.log("Error: " + secureWebSocket.errorString)
                                 } else if (secureWebSocket.status == WebSocket.Open) {
                                     secureWebSocket.sendTextMessage("Hello Secure World")
                                 } else if (secureWebSocket.status == WebSocket.Closed) {
                                     console.log("\nSecure socket closed")
                                 }
                active: false
            }
    

    I also added websockets in the .pro file and imported websockets in my main.qml

    The error i get is :

     WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
    qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
    qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
    

    Thanks :)

    E 1 Reply Last reply
    0
    • T the-smaug

      Hi,

      Actually having trouble with websocket in Qml.
      What i want : a nodejs server with a qml client

      My node js server seems to work, because when i instanciate a Websocket in Chrome console it works

      Here is my client

       WebSocket {
                  id: secureWebSocket
                  url: "ws://localhost:3000"
                  onTextMessageReceived: {
                      console.log("\nReceived secure message: ")
                  }
                  onStatusChanged: if (secureWebSocket.status == WebSocket.Error) {
                                       console.log("Error: " + secureWebSocket.errorString)
                                   } else if (secureWebSocket.status == WebSocket.Open) {
                                       secureWebSocket.sendTextMessage("Hello Secure World")
                                   } else if (secureWebSocket.status == WebSocket.Closed) {
                                       console.log("\nSecure socket closed")
                                   }
                  active: false
              }
      

      I also added websockets in the .pro file and imported websockets in my main.qml

      The error i get is :

       WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
      qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
      qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
      

      Thanks :)

      E Offline
      E Offline
      Eeli K
      wrote on last edited by
      #2

      @the-smaug said in QML, Node js and websocket:

      qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method

      I suggest you do a google search for this error.

      1 Reply Last reply
      0
      • cfdevC Offline
        cfdevC Offline
        cfdev
        wrote on last edited by
        #3

        OpenSSL @the-smaug

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Leandro
          wrote on last edited by Leandro
          #4

          If you are using a Linux Distro, you have to install qt-at-spi:

          sudo apt-get install at-spi2-core

          or

          sudo apt-get install qt-at-spi

          or something like it to rpm or other distro (Arch/Gentoo/...).

          As the error says: Error retrieving accessibility bus address

          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